Class: Maquina::User
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Maquina::User
- Includes:
- AuthenticateBy, Blockeable, Multifactor, RetainPasswords
- Defined in:
- app/models/maquina/user.rb
Constant Summary collapse
- PASSWORD_COMPLEXITY_REGEX =
/\A(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#-=+])[A-Za-z\d@$!%*?&#-=+]{8,}\z/
Instance Method Summary collapse
Methods inherited from ApplicationRecord
Instance Method Details
#default_membership ⇒ Object
27 28 29 30 31 |
# File 'app/models/maquina/user.rb', line 27 def default_membership return nil if management? memberships.detect { |membership| membership.blocked_at.blank? && membership.organization.present? && membership.organization.active? } end |
#expired_password? ⇒ Boolean
21 22 23 24 25 |
# File 'app/models/maquina/user.rb', line 21 def expired_password? return false if password_expires_at.blank? password_expires_at < Time.zone.now end |