diff options
Diffstat (limited to 'activerecord/test/models/post.rb')
-rw-r--r-- | activerecord/test/models/post.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index a99ab12b19..4aba336b01 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -199,6 +199,11 @@ class FirstPost < ActiveRecord::Base has_one :comment, foreign_key: :post_id end +class TaggedPost < Post + has_many :taggings, -> { rewhere(taggable_type: "TaggedPost") }, as: :taggable + has_many :tags, through: :taggings +end + class PostWithDefaultInclude < ActiveRecord::Base self.inheritance_column = :disabled self.table_name = "posts" |