Skip to content

Commit 3cc6877

Browse files
committed
feat: numericality validation presence
1 parent eed9710 commit 3cc6877

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/anchor/resource.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def anchor_attributes_properties(included_fields:)
7878
if v.is_a?(ActiveRecord::Validations::UniquenessValidator)
7979
opts = v.options.with_indifferent_access
8080
!(opts[:allow_nil] || opts[:allow_blank])
81+
elsif v.is_a?(ActiveRecord::Validations::NumericalityValidator)
82+
opts = v.options.with_indifferent_access
83+
!opts[:allow_nil]
8184
else
8285
v.is_a?(ActiveRecord::Validations::PresenceValidator)
8386
end

0 commit comments

Comments
 (0)