Files
fizzy/app/models/identity/joinable.rb
T
2025-11-17 09:12:39 -05:00

16 lines
304 B
Ruby

module Identity::Joinable
extend ActiveSupport::Concern
def join(account, **attributes)
attributes[:name] ||= email_address
transaction do
account.users.create!(**attributes, identity: self)
end
end
def member_of?(account)
account.users.exists?(identity: self)
end
end