mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 02:33:03 -04: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
|