fix step does not save if table is without content

This commit is contained in:
Mojca Lorber 2017-01-27 16:25:11 +01:00
parent 53e09bd50a
commit d5021fad2c

View file

@ -35,7 +35,7 @@ class Step < ActiveRecord::Base
reject_if: :all_blank,
allow_destroy: true
accepts_nested_attributes_for :tables,
reject_if: :all_blank,
reject_if: proc { |attributes| attributes['contents'].blank? },
allow_destroy: true
after_destroy :cascade_after_destroy