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:
mlorb 2017-01-30 11:08:21 +01:00 committed by GitHub
commit bc8c4c3c6c

View file

@ -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