Module: Clubhouse::Concerns::Services::CreateOrganization
- Extended by:
- ActiveSupport::Concern
- Includes:
- Servitore::Service
- Included in:
- Clubhouse::CreateOrganization
- Defined in:
- lib/clubhouse/concerns/services/create_organization.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/clubhouse/concerns/services/create_organization.rb', line 13 def call ActiveRecord::Base.transaction do organization.tap do |o| o.assign_attributes(params) o.save! o.memberships.create!(member: user, admin: true) end end end |