Fix Rails/DeprecatedActiveModelErrorsMethods cop (#24742)
This commit is contained in:
parent
b5c4b47746
commit
24491abf6d
|
@ -1169,12 +1169,6 @@ Rails/CreateTableWithTimestamps:
|
||||||
- 'db/migrate/20220824233535_create_status_trends.rb'
|
- 'db/migrate/20220824233535_create_status_trends.rb'
|
||||||
- 'db/migrate/20221006061337_create_preview_card_trends.rb'
|
- 'db/migrate/20221006061337_create_preview_card_trends.rb'
|
||||||
|
|
||||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
||||||
# Configuration parameters: Severity.
|
|
||||||
Rails/DeprecatedActiveModelErrorsMethods:
|
|
||||||
Exclude:
|
|
||||||
- 'lib/mastodon/accounts_cli.rb'
|
|
||||||
|
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
# This cop supports safe autocorrection (--autocorrect).
|
||||||
# Configuration parameters: Severity.
|
# Configuration parameters: Severity.
|
||||||
Rails/DuplicateAssociation:
|
Rails/DuplicateAssociation:
|
||||||
|
|
|
@ -121,10 +121,10 @@ module Mastodon
|
||||||
say('OK', :green)
|
say('OK', :green)
|
||||||
say("New password: #{password}")
|
say("New password: #{password}")
|
||||||
else
|
else
|
||||||
user.errors.to_h.each do |key, error|
|
user.errors.each do |error|
|
||||||
say('Failure/Error: ', :red)
|
say('Failure/Error: ', :red)
|
||||||
say(key)
|
say(error.attribute)
|
||||||
say(" #{error}", :red)
|
say(" #{error.type}", :red)
|
||||||
end
|
end
|
||||||
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
@ -197,10 +197,10 @@ module Mastodon
|
||||||
say('OK', :green)
|
say('OK', :green)
|
||||||
say("New password: #{password}") if options[:reset_password]
|
say("New password: #{password}") if options[:reset_password]
|
||||||
else
|
else
|
||||||
user.errors.to_h.each do |key, error|
|
user.errors.each do |error|
|
||||||
say('Failure/Error: ', :red)
|
say('Failure/Error: ', :red)
|
||||||
say(key)
|
say(error.attribute)
|
||||||
say(" #{error}", :red)
|
say(" #{error.type}", :red)
|
||||||
end
|
end
|
||||||
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Reference in New Issue