File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,13 @@ def anchor_attributes_properties(included_fields:)
8080 if check_presence && _model_class . validators_on ( model_method ) . any? do |v |
8181 if v . is_a? ( ActiveRecord ::Validations ::UniquenessValidator )
8282 opts = v . options . with_indifferent_access
83- !( opts [ :allow_nil ] || opts [ :allow_blank ] )
83+ !( opts [ :allow_nil ] || opts [ :allow_blank ] || opts [ :if ] || opts [ :unless ] || opts [ :on ] )
8484 elsif v . is_a? ( ActiveRecord ::Validations ::NumericalityValidator )
8585 opts = v . options . with_indifferent_access
86- !opts [ :allow_nil ]
87- else
88- v . is_a? ( ActiveRecord ::Validations ::PresenceValidator )
86+ !( opts [ :allow_nil ] || opts [ :if ] || opts [ :unless ] || opts [ :on ] )
87+ elsif v . is_a? ( ActiveRecord ::Validations ::PresenceValidator )
88+ opts = v . options . with_indifferent_access
89+ !( opts [ :if ] || opts [ :unless ] || opts [ :on ] )
8990 end
9091 end
9192 type . type
You can’t perform that action at this time.
0 commit comments