##// END OF EJS Templates
set_table_name and set_locking_column are deprecated....
Jean-Philippe Lang -
r9367:d940797aa79f
parent child
Show More
@@ -16,7 +16,7
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class Principal < ActiveRecord::Base
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 has_many :members, :foreign_key => 'user_id', :dependent => :destroy
21 has_many :members, :foreign_key => 'user_id', :dependent => :destroy
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"
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"
@@ -18,7 +18,7
18 require 'zlib'
18 require 'zlib'
19
19
20 class WikiContent < ActiveRecord::Base
20 class WikiContent < ActiveRecord::Base
21 set_locking_column :version
21 self.locking_column = 'version'
22 belongs_to :page, :class_name => 'WikiPage', :foreign_key => 'page_id'
22 belongs_to :page, :class_name => 'WikiPage', :foreign_key => 'page_id'
23 belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
23 belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
24 validates_presence_of :text
24 validates_presence_of :text
@@ -273,7 +273,7 module ActiveRecord #:nodoc:
273
273
274 versioned_class.cattr_accessor :original_class
274 versioned_class.cattr_accessor :original_class
275 versioned_class.original_class = self
275 versioned_class.original_class = self
276 versioned_class.set_table_name versioned_table_name
276 versioned_class.table_name = versioned_table_name
277 versioned_class.belongs_to self.to_s.demodulize.underscore.to_sym,
277 versioned_class.belongs_to self.to_s.demodulize.underscore.to_sym,
278 :class_name => "::#{self.to_s}",
278 :class_name => "::#{self.to_s}",
279 :foreign_key => versioned_foreign_key
279 :foreign_key => versioned_foreign_key
@@ -1,6 +1,6
1 module OpenIdAuthentication
1 module OpenIdAuthentication
2 class Association < ActiveRecord::Base
2 class Association < ActiveRecord::Base
3 set_table_name :open_id_authentication_associations
3 self.table_name = :open_id_authentication_associations
4
4
5 def from_record
5 def from_record
6 OpenID::Association.new(handle, secret, issued, lifetime, assoc_type)
6 OpenID::Association.new(handle, secret, issued, lifetime, assoc_type)
@@ -1,5 +1,5
1 module OpenIdAuthentication
1 module OpenIdAuthentication
2 class Nonce < ActiveRecord::Base
2 class Nonce < ActiveRecord::Base
3 set_table_name :open_id_authentication_nonces
3 self.table_name = :open_id_authentication_nonces
4 end
4 end
5 end
5 end
General Comments 0
You need to be logged in to leave comments. Login now