Skip to content

Commit

Permalink
renew deprecated methods (#1444)
Browse files Browse the repository at this point in the history
* renew deprecated methods

* replace "attribute_names" with the methods that exist in the Rails 5.2 and 6.0 APIs
  • Loading branch information
ryu-sato committed Jun 12, 2021
1 parent b3c7923 commit 7663821
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/shoulda/matchers/active_model/helpers.rb
Expand Up @@ -8,7 +8,7 @@ def pretty_error_messages(object)
end

def format_validation_errors(errors)
list_items = errors.keys.map do |attribute|
list_items = errors.to_hash.keys.map do |attribute|
messages = errors[attribute]
"* #{attribute}: #{messages}"
end
Expand Down
Expand Up @@ -73,7 +73,7 @@ def record_with_custom_validation

def custom_validation # rubocop:disable Lint/NestedMethodDefinition
if self[:attr] != 'good value'
errors[:attr2] << 'some message'
errors.add :attr2, 'some message'
end
end
end.new
Expand Down

0 comments on commit 7663821

Please sign in to comment.