Module: MinimalistAuthentication::User::ClassMethods
- Defined in:
- lib/minimalist_authentication/user.rb
Instance Method Summary collapse
-
#find_enabled(id) ⇒ Object
Finds an enabled user by id.
-
#find_enabled_by ⇒ Object
Finds a user matching the specified conditions and returns the user if they are enabled.
- #inactive ⇒ Object
-
#password_minimum ⇒ Object
Minimum password length.
Instance Method Details
#find_enabled(id) ⇒ Object
Finds an enabled user by id.
53 54 55 |
# File 'lib/minimalist_authentication/user.rb', line 53 def find_enabled(id) find_enabled_by(id:) if id.present? end |
#find_enabled_by ⇒ Object
Finds a user matching the specified conditions and returns the user if they are enabled. Returns nil if a user is not found or not enabled.
59 60 61 |
# File 'lib/minimalist_authentication/user.rb', line 59 def find_enabled_by(**) find_by(**)&.enabled end |
#inactive ⇒ Object
63 64 65 66 67 68 |
# File 'lib/minimalist_authentication/user.rb', line 63 def inactive MinimalistAuthentication.deprecator.warn(<<-MSG.squish) Calling #inactive is deprecated. Use #active(false) instead. MSG active(false) end |
#password_minimum ⇒ Object
Minimum password length
71 |
# File 'lib/minimalist_authentication/user.rb', line 71 def password_minimum = 12 |