mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-08 14:15:35 +08:00
fixes bug with step table update [fixes SCI-2026]
This commit is contained in:
parent
f67f633562
commit
b48fa3f231
1 changed files with 3 additions and 3 deletions
|
@ -547,9 +547,9 @@ class StepsController < ApplicationController
|
||||||
# Delete the step table
|
# Delete the step table
|
||||||
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 |key, table|
|
||||||
next unless table.second['_destroy']
|
next unless table['_destroy']
|
||||||
table_to_destroy = Table.find_by(id: table.second['id'])
|
table_to_destroy = Table.find_by_id(table['id'])
|
||||||
table_to_destroy.report_elements.destroy_all
|
table_to_destroy.report_elements.destroy_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue