From d5021fad2c007a6b8e6126c1a555a44e7f91c85d Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Fri, 27 Jan 2017 16:25:11 +0100 Subject: [PATCH] fix step does not save if table is without content --- app/models/step.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/step.rb b/app/models/step.rb index 3d329096d..42c2a1657 100644 --- a/app/models/step.rb +++ b/app/models/step.rb @@ -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