aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/comment.rb2
-rw-r--r--activerecord/test/models/topic.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/models/comment.rb b/activerecord/test/models/comment.rb
index 00f5a74070..cf73c28ded 100644
--- a/activerecord/test/models/comment.rb
+++ b/activerecord/test/models/comment.rb
@@ -9,6 +9,8 @@ class Comment < ActiveRecord::Base
belongs_to :post, :counter_cache => true
has_many :ratings
+ belongs_to :first_post, :foreign_key => :post_id
+
has_many :children, :class_name => 'Comment', :foreign_key => :parent_id
belongs_to :parent, :class_name => 'Comment', :counter_cache => :children_count
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index 785839be75..0625b8d296 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -45,8 +45,8 @@ class Topic < ActiveRecord::Base
2
end
end
- scope :named_extension, -> { { :extend => NamedExtension } }
- scope :multiple_extensions, -> { { :extend => [MultipleExtensionTwo, MultipleExtensionOne] } }
+ scope :named_extension, :extend => NamedExtension
+ scope :multiple_extensions, :extend => [MultipleExtensionTwo, MultipleExtensionOne]
has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title"