aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/club.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/club.rb')
-rw-r--r--activerecord/test/models/club.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/models/club.rb b/activerecord/test/models/club.rb
index 49d7b24a3b..2006e05fcf 100644
--- a/activerecord/test/models/club.rb
+++ b/activerecord/test/models/club.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Club < ActiveRecord::Base
has_one :membership
has_many :memberships, inverse_of: false
@@ -8,6 +10,8 @@ class Club < ActiveRecord::Base
has_many :favourites, -> { where(memberships: { favourite: true }) }, through: :memberships, source: :member
+ scope :general, -> { left_joins(:category).where(categories: { name: "General" }) }
+
private
def private_method