mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-03 15:07:48 -05:00
12 lines
257 B
Ruby
12 lines
257 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Ownable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
belongs_to :owner, class_name: 'Member', counter_cache: true
|
|
|
|
default_scope { joins(:owner).merge(Member.kept) } # Ensures the owner still exists
|
|
end
|
|
end
|