|
|
@ -91,7 +91,7 @@ class OrganisationsController < ApplicationController |
|
|
|
selected_rent_periods = rent_period_params[:rent_periods].compact_blank |
|
|
|
selected_rent_periods = rent_period_params[:rent_periods].compact_blank |
|
|
|
@organisation = Organisation.new(org_params) |
|
|
|
@organisation = Organisation.new(org_params) |
|
|
|
if @organisation.save |
|
|
|
if @organisation.save |
|
|
|
@organisation.update(group: assign_group_number(@organisation.id, org_params[:group_member_id])) if org_params[:group_member] |
|
|
|
@organisation.update!(group: assign_group_number(@organisation.id, org_params[:group_member_id])) if org_params[:group_member] |
|
|
|
OrganisationRentPeriod.transaction do |
|
|
|
OrganisationRentPeriod.transaction do |
|
|
|
selected_rent_periods.each { |period| OrganisationRentPeriod.create!(organisation: @organisation, rent_period: period) } |
|
|
|
selected_rent_periods.each { |period| OrganisationRentPeriod.create!(organisation: @organisation, rent_period: period) } |
|
|
|
end |
|
|
|
end |
|
|
|