Patch #10786 ยป redmine.table_name.diff
| app/models/principal.rb | ||
|---|---|---|
| 16 | 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | 17 | |
| 18 | 18 |
class Principal < ActiveRecord::Base |
| 19 |
set_table_name "#{table_name_prefix}users#{table_name_suffix}"
|
|
| 19 |
self.table_name = "#{table_name_prefix}users#{table_name_suffix}"
|
|
| 20 | 20 | |
| 21 | 21 |
has_many :members, :foreign_key => 'user_id', :dependent => :destroy |
| 22 | 22 |
has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name"
|
| lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb | ||
|---|---|---|
| 273 | 273 | |
| 274 | 274 |
versioned_class.cattr_accessor :original_class |
| 275 | 275 |
versioned_class.original_class = self |
| 276 |
versioned_class.set_table_name versioned_table_name
|
|
| 276 |
versioned_class.table_name = versioned_table_name
|
|
| 277 | 277 |
versioned_class.belongs_to self.to_s.demodulize.underscore.to_sym, |
| 278 | 278 |
:class_name => "::#{self.to_s}",
|
| 279 | 279 |
:foreign_key => versioned_foreign_key |
| lib/plugins/awesome_nested_set/spec/awesome_nested_set_spec.rb | ||
|---|---|---|
| 763 | 763 |
|
| 764 | 764 |
it "should not error on a model with attr_accessible" do |
| 765 | 765 |
model = Class.new(ActiveRecord::Base) |
| 766 |
model.set_table_name 'categories'
|
|
| 766 |
model.table_name = 'categories'
|
|
| 767 | 767 |
model.attr_accessible :name |
| 768 | 768 |
lambda {
|
| 769 | 769 |
model.acts_as_nested_set |
| lib/plugins/awesome_nested_set/spec/support/models.rb | ||
|---|---|---|
| 3 | 3 |
end |
| 4 | 4 |
|
| 5 | 5 |
class Default < ActiveRecord::Base |
| 6 |
set_table_name 'categories'
|
|
| 6 |
self.table_name = 'categories'
|
|
| 7 | 7 |
acts_as_nested_set |
| 8 | 8 |
end |
| 9 | 9 |
|
| 10 | 10 |
class ScopedCategory < ActiveRecord::Base |
| 11 |
set_table_name 'categories'
|
|
| 11 |
self.table_name = 'categories'
|
|
| 12 | 12 |
acts_as_nested_set :scope => :organization |
| 13 | 13 |
end |
| 14 | 14 |
|
| ... | ... | |
| 48 | 48 |
|
| 49 | 49 |
class DefaultWithCallbacks < ActiveRecord::Base |
| 50 | 50 |
|
| 51 |
set_table_name 'categories'
|
|
| 51 |
self.table_name = 'categories'
|
|
| 52 | 52 |
|
| 53 | 53 |
attr_accessor :before_add, :after_add, :before_remove, :after_remove |
| 54 | 54 |
|
| lib/plugins/awesome_nested_set/test/awesome_nested_set_test.rb | ||
|---|---|---|
| 8 | 8 | |
| 9 | 9 |
class Default < ActiveRecord::Base |
| 10 | 10 |
acts_as_nested_set |
| 11 |
set_table_name 'categories'
|
|
| 11 |
self.table_name = 'categories'
|
|
| 12 | 12 |
end |
| 13 | 13 |
class Scoped < ActiveRecord::Base |
| 14 | 14 |
acts_as_nested_set :scope => :organization |
| 15 |
set_table_name 'categories'
|
|
| 15 |
self.table_name = 'categories'
|
|
| 16 | 16 |
end |
| 17 | 17 | |
| 18 | 18 |
def test_left_column_default |
| lib/plugins/classic_pagination/test/fixtures/developer.rb | ||
|---|---|---|
| 3 | 3 |
end |
| 4 | 4 | |
| 5 | 5 |
class DeVeLoPeR < ActiveRecord::Base |
| 6 |
set_table_name "developers"
|
|
| 6 |
self.table_name = "developers"
|
|
| 7 | 7 |
end |
| lib/plugins/open_id_authentication/lib/open_id_authentication/association.rb | ||
|---|---|---|
| 1 | 1 |
module OpenIdAuthentication |
| 2 | 2 |
class Association < ActiveRecord::Base |
| 3 |
set_table_name :open_id_authentication_associations
|
|
| 3 |
self.table_name = :open_id_authentication_associations
|
|
| 4 | 4 | |
| 5 | 5 |
def from_record |
| 6 | 6 |
OpenID::Association.new(handle, secret, issued, lifetime, assoc_type) |
| lib/plugins/open_id_authentication/lib/open_id_authentication/nonce.rb | ||
|---|---|---|
| 1 | 1 |
module OpenIdAuthentication |
| 2 | 2 |
class Nonce < ActiveRecord::Base |
| 3 |
set_table_name :open_id_authentication_nonces
|
|
| 3 |
self.table_name = :open_id_authentication_nonces
|
|
| 4 | 4 |
end |
| 5 | 5 |
end |