Class: Ecom::Core::User

Inherits:
ApplicationRecord show all
Defined in:
app/models/ecom/core/user.rb

Constant Summary collapse

VALID_EMAIL_REGEX =
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i.freeze

Instance Method Summary collapse

Instance Method Details

#full_nameObject



15
16
17
# File 'app/models/ecom/core/user.rb', line 15

def full_name
  "#{first_name} #{last_name}"
end

#roles_for_module(code) ⇒ Object



19
20
21
# File 'app/models/ecom/core/user.rb', line 19

def roles_for_module(code)
  user_roles.joins(:application_module).where('ecom_core_application_modules.code = ?', code)
end