Skip to content

Commit

Permalink
Merge pull request #832 from DavyJonesLocker/bugfix/fix-rails-edge-su…
Browse files Browse the repository at this point in the history
…pport

Fix support for Rails edge (7.0.0.alpha)
  • Loading branch information
tagliala committed Apr 24, 2021
2 parents 88b73c3 + 0d5bd31 commit 027fea2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/client_side_validations/active_model/numericality.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ module Numericality
@@option_map = {}

def self.included(base)
@@option_map.merge!(base::CHECKS.keys.inject({}) { |acc, elem| acc.merge!(elem => elem) })
checks =
if base.const_defined?('RESERVED_OPTIONS')
base::RESERVED_OPTIONS - [:only_integer]
else
base::CHECKS.keys
end

@@option_map.merge!(checks.inject({}) { |acc, elem| acc.merge!(elem => elem) })
super
end

Expand Down

0 comments on commit 027fea2

Please sign in to comment.