We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e8e9da commit 3b938b7Copy full SHA for 3b938b7
lib/dynamoid/validations.rb
@@ -50,7 +50,10 @@ def validates_presence_of(*attr_names)
50
class PresenceValidator < ActiveModel::EachValidator
51
# Validate the record for the record and value.
52
def validate_each(record, attr_name, value)
53
- record.errors.add(attr_name, :blank, options) if not_present?(value)
+ # Use keyword argument `options` because it was a Hash in Rails < 6.1
54
+ # and became a keyword argument in 6.1. This way it works in both
55
+ # cases.
56
+ record.errors.add(attr_name, :blank, **options) if not_present?(value)
57
end
58
59
private
0 commit comments