fixed multiple tables check

This commit is contained in:
zmagod 2016-09-01 13:49:12 +02:00
parent 111cb81d08
commit 4afaa50ce0

View file

@ -520,7 +520,7 @@ class StepsController < ApplicationController
def delete_step_tables(params)
return unless params[:tables_attributes].present?
params[:tables_attributes].each do |table|
next unless table.second['_destroy'] != 1
next unless table.second['_destroy']
table_to_destroy = Table.find_by(id: table.second['id'])
table_to_destroy.report_elements.destroy_all
end