diff options
Diffstat (limited to 'activerecord/test/models/club.rb')
-rw-r--r-- | activerecord/test/models/club.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/models/club.rb b/activerecord/test/models/club.rb index 2006e05fcf..890e427616 100644 --- a/activerecord/test/models/club.rb +++ b/activerecord/test/models/club.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Club < ActiveRecord::Base - has_one :membership + has_one :membership, touch: true has_many :memberships, inverse_of: false has_many :members, through: :memberships has_one :sponsor @@ -10,10 +10,11 @@ class Club < ActiveRecord::Base has_many :favourites, -> { where(memberships: { favourite: true }) }, through: :memberships, source: :member - scope :general, -> { left_joins(:category).where(categories: { name: "General" }) } + scope :general, -> { left_joins(:category).where(categories: { name: "General" }).unscope(:limit) } - private + accepts_nested_attributes_for :membership + private def private_method "I'm sorry sir, this is a *private* club, not a *pirate* club" end |