aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/comment.rb1
-rw-r--r--activerecord/test/models/rating.rb4
2 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/models/comment.rb b/activerecord/test/models/comment.rb
index ede5fbd0c6..6a9dfacf56 100644
--- a/activerecord/test/models/comment.rb
+++ b/activerecord/test/models/comment.rb
@@ -35,4 +35,5 @@ class SubSpecialComment < SpecialComment
end
class VerySpecialComment < Comment
+ scope :special_parent, -> (special_rating) { where parent_id: special_rating.special_comment.id }
end
diff --git a/activerecord/test/models/rating.rb b/activerecord/test/models/rating.rb
index 25a52c4ad7..5409230c2e 100644
--- a/activerecord/test/models/rating.rb
+++ b/activerecord/test/models/rating.rb
@@ -2,3 +2,7 @@ class Rating < ActiveRecord::Base
belongs_to :comment
has_many :taggings, :as => :taggable
end
+
+class SpecialRating < Rating
+ belongs_to :special_comment
+end