1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

custom price on all occurrences with recursive event creation

This commit is contained in:
Sylvain 2016-08-30 09:37:05 +02:00
parent 8aef50660a
commit cd038a8550

View File

@ -77,6 +77,10 @@ class Event < ActiveRecord::Base
efs = event_files.map do |f|
EventFile.new(attachment: f.attachment)
end
event_price_cats = []
event_price_categories.each do |epc|
event_price_cats.push(EventPriceCategory.new(price_category_id: epc.price_category_id, amount: epc.amount))
end
event = Event.new({
recurrence: 'none',
title: title,
@ -87,7 +91,7 @@ class Event < ActiveRecord::Base
availability_id: nil,
category_id: category_id,
amount: amount,
reduced_amount: reduced_amount,
event_price_categories: event_price_cats,
nb_total_places: nb_total_places,
recurrence_id: id
})