diff options
Diffstat (limited to 'activerecord/test/models/topic.rb')
-rw-r--r-- | activerecord/test/models/topic.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb index f7f4cebc5a..f81ffe1d90 100644 --- a/activerecord/test/models/topic.rb +++ b/activerecord/test/models/topic.rb @@ -34,7 +34,6 @@ class Topic < ActiveRecord::Base has_many :replies, :dependent => :destroy, :foreign_key => "parent_id" has_many :approved_replies, -> { approved }, class_name: 'Reply', foreign_key: "parent_id", counter_cache: 'replies_count' - has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title" has_many :unique_replies, :dependent => :destroy, :foreign_key => "parent_id" has_many :silly_unique_replies, :dependent => :destroy, :foreign_key => "parent_id" @@ -107,7 +106,12 @@ class ImportantTopic < Topic serialize :important, Hash end +class DefaultRejectedTopic < Topic + default_scope -> { where(approved: false) } +end + class BlankTopic < Topic + # declared here to make sure that dynamic finder with a bang can find a model that responds to `blank?` def blank? true end |