diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-20 21:35:58 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-20 21:35:58 -0300 |
commit | 9a1abedcdeecd9464668695d4f9c1d55a2fd9332 (patch) | |
tree | 287c625ff80dc7feeddea2dcb5a59ce6783a9cd3 /activerecord/test/models | |
parent | c72d6c91a7c0c2dc81cc857a1d6db496e84e0065 (diff) | |
parent | 9c3afdc327132c7f1f4d05eebc0c05b715442e7d (diff) | |
download | rails-9a1abedcdeecd9464668695d4f9c1d55a2fd9332.tar.gz rails-9a1abedcdeecd9464668695d4f9c1d55a2fd9332.tar.bz2 rails-9a1abedcdeecd9464668695d4f9c1d55a2fd9332.zip |
Merge pull request #14544 from jefflai2/named_scope_sti
Fixes Issue #13466.
Conflicts:
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/comment.rb | 1 | ||||
-rw-r--r-- | activerecord/test/models/rating.rb | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/models/comment.rb b/activerecord/test/models/comment.rb index bf0162d09b..ea261ac9ec 100644 --- a/activerecord/test/models/comment.rb +++ b/activerecord/test/models/comment.rb @@ -39,6 +39,7 @@ class SubSpecialComment < SpecialComment end class VerySpecialComment < Comment + scope :special_parent, -> (special_rating) { where parent_id: special_rating.special_comment.id } end class CommentThatAutomaticallyAltersPostBody < Comment 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 |