GeekPark/gpk_account

View on GitHub
app/models/user/reset_password.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use find_by instead of dynamic find_by_email_or_mobile. (https://github.com/bbatsov/rails-style-guide#find_by)
Open

    User.find_by_email_or_mobile(login_name)
Severity: Minor
Found in app/models/user/reset_password.rb by rubocop

This cop checks dynamic find_by_* methods. Use find_by instead of dynamic method. See. https://github.com/bbatsov/rails-style-guide#find_by

Example:

# bad
User.find_by_name(name)

# bad
User.find_by_name_and_email(name)

# bad
User.find_by_email!(name)

# good
User.find_by(name: name)

# good
User.find_by(name: name, email: email)

# good
User.find_by!(email: email)

There are no issues that match your filters.

Category
Status