1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

fix bug for update event recurrent

This commit is contained in:
Du Peng 2020-01-30 12:03:50 +01:00
parent fd0f49f132
commit 05073d5a28

View File

@ -123,7 +123,7 @@ class EventService
amount: epca['amount'],
_destroy: epca['_destroy']
)
else
elsif epca['id'].present?
event_price = event.event_price_categories.find(epca['id'])
epc_attributes.push(
price_category_id: epca['price_category_id'],
@ -154,14 +154,20 @@ class EventService
ef_attributes.push(efa)
end
end
unless ef_attributes.empty?
e_params = e_params.merge(
event_files_attributes: ef_attributes
)
end
begin
results.push status: !!e.update(e_params.permit!), event: e # rubocop:disable Style/DoubleNegation
rescue => err
results.push status: false, event: e, error: err.try(:record).try(:class).try(:name), message: err.message # rubocop:disable Style/DoubleNegation
end
end
begin
results.push status: !!event.update(event_params), event: event # rubocop:disable Style/DoubleNegation
rescue => err
results.push status: false, event: event, error: err.try(:record).try(:class).try(:name), message: err.message # rubocop:disable Style/DoubleNegation
end
results
end
end