@@ -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 |
se |
|
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 |
se |
|
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. |
|
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 |
se |
|
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) |
General Comments 0
You need to be logged in to leave comments.
Login now