Module: MinimalistAuthentication::User::ClassMethods
- Defined in:
- lib/minimalist_authentication/user.rb
Instance Method Summary collapse
-
#find_enabled(id) ⇒ Object
Finds a user by their id and returns the user if they are enabled.
- #inactive ⇒ Object
-
#password_minimum ⇒ Object
Minimum password length.
Instance Method Details
#find_enabled(id) ⇒ Object
Finds a user by their id and returns the user if they are enabled. Returns nil if the user is not found or not enabled.
44 45 46 |
# File 'lib/minimalist_authentication/user.rb', line 44 def find_enabled(id) find_by(id:)&.enabled if id.present? end |
#inactive ⇒ Object
48 49 50 51 52 53 |
# File 'lib/minimalist_authentication/user.rb', line 48 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
56 |
# File 'lib/minimalist_authentication/user.rb', line 56 def password_minimum = 12 |