6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/spree/admin/classifications_controller.rb', line 6
def recalculate_conversions
if @taxon.parent.event?
SpreeCmCommissioner::MaintenanceTasks::Event.pending.find_or_create_by(
maintainable_type: 'Spree::Taxon',
maintainable_id: @taxon.parent.id
) do |task|
task.manually_triggered = true
end.async_execute
flash[:success] = flash_message_for(@taxon, :successfully_updated)
else
flash[:error] = 'Conversion recalculation can only be performed for taxons under an event.' end
redirect_to collection_url
end
|