mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-01 20:48:23 +08:00
Merge pull request #463 from mlorb/ml_sci_965
Fix step does not save if table is without content [SCI-965]
This commit is contained in:
commit
bc8c4c3c6c
1 changed files with 8 additions and 6 deletions
|
@ -29,14 +29,16 @@ class Step < ActiveRecord::Base
|
|||
dependent: :destroy
|
||||
|
||||
accepts_nested_attributes_for :checklists,
|
||||
reject_if: :all_blank,
|
||||
allow_destroy: true
|
||||
reject_if: :all_blank,
|
||||
allow_destroy: true
|
||||
accepts_nested_attributes_for :assets,
|
||||
reject_if: :all_blank,
|
||||
allow_destroy: true
|
||||
reject_if: :all_blank,
|
||||
allow_destroy: true
|
||||
accepts_nested_attributes_for :tables,
|
||||
reject_if: :all_blank,
|
||||
allow_destroy: true
|
||||
reject_if: proc { |attributes|
|
||||
attributes['contents'].blank?
|
||||
},
|
||||
allow_destroy: true
|
||||
|
||||
after_destroy :cascade_after_destroy
|
||||
before_save :set_last_modified_by
|
||||
|
|
Loading…
Reference in a new issue