Rails 6.1 Fix warning (#2983)

* Rails 6.1

* Bump rails

* Fix warning

* Fix tests
This commit is contained in:
Daniel O'Connor
2022-03-30 01:23:11 +10:30
committed by GitHub
parent 99b11c3eb6
commit 07d40a20dd

View File

@@ -2,6 +2,6 @@
class ApprovedValidator < ActiveModel::EachValidator
def validate_each(record, attribute, _value)
record.errors[attribute] << (options[:message] || 'must be approved') unless record.crop.try(:approved?)
record.errors.add(attribute, options[:message] || 'must be approved') unless record.crop.try(:approved?)
end
end