mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-10 06:37:32 +08:00
fixed multiple tables check
This commit is contained in:
parent
111cb81d08
commit
4afaa50ce0
1 changed files with 1 additions and 1 deletions
|
@ -520,7 +520,7 @@ class StepsController < ApplicationController
|
||||||
def delete_step_tables(params)
|
def delete_step_tables(params)
|
||||||
return unless params[:tables_attributes].present?
|
return unless params[:tables_attributes].present?
|
||||||
params[:tables_attributes].each do |table|
|
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 = Table.find_by(id: table.second['id'])
|
||||||
table_to_destroy.report_elements.destroy_all
|
table_to_destroy.report_elements.destroy_all
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue