mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
custom price on all occurrences with recursive event creation
This commit is contained in:
parent
8aef50660a
commit
cd038a8550
@ -77,6 +77,10 @@ class Event < ActiveRecord::Base
|
|||||||
efs = event_files.map do |f|
|
efs = event_files.map do |f|
|
||||||
EventFile.new(attachment: f.attachment)
|
EventFile.new(attachment: f.attachment)
|
||||||
end
|
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({
|
event = Event.new({
|
||||||
recurrence: 'none',
|
recurrence: 'none',
|
||||||
title: title,
|
title: title,
|
||||||
@ -87,7 +91,7 @@ class Event < ActiveRecord::Base
|
|||||||
availability_id: nil,
|
availability_id: nil,
|
||||||
category_id: category_id,
|
category_id: category_id,
|
||||||
amount: amount,
|
amount: amount,
|
||||||
reduced_amount: reduced_amount,
|
event_price_categories: event_price_cats,
|
||||||
nb_total_places: nb_total_places,
|
nb_total_places: nb_total_places,
|
||||||
recurrence_id: id
|
recurrence_id: id
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user