File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ detectors:
2626 exclude :
2727 - ' YAAF::Form#promote_legacy_errors'
2828 - ' YAAF::Form#save_models'
29+ - ' YAAF::Form#validate_models'
2930 InstanceVariableAssumption :
3031 enabled : false
3132 IrresponsibleModule :
@@ -46,6 +47,7 @@ detectors:
4647 enabled : true
4748 exclude :
4849 - ' YAAF::Form#save_models'
50+ - ' YAAF::Form#validate_models'
4951 MissingSafeMethod :
5052 enabled : false
5153 exclude : []
Original file line number Diff line number Diff line change @@ -62,7 +62,11 @@ def save_models(options)
6262 end
6363
6464 def validate_models
65- models . each { |model | promote_errors ( model ) if model . invalid? }
65+ models . each do |model |
66+ next if model . respond_to? ( :marked_for_destruction? ) && model . marked_for_destruction?
67+
68+ promote_errors ( model ) if model . invalid?
69+ end
6670 end
6771
6872 def promote_errors ( model )
You can’t perform that action at this time.
0 commit comments