Class: Spree::User

Inherits:
Base
  • Object
show all
Includes:
UserMethods
Defined in:
app/models/spree/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.admin_created?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/models/spree/user.rb', line 24

def self.admin_created?
  User.admin.count > 0
end

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/models/spree/user.rb', line 28

def admin?
  has_spree_role?('admin')
end

#confirmed?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'app/models/spree/user.rb', line 32

def confirmed?
  !!confirmed_at
end

#password=(new_password) ⇒ Object



12
13
14
15
# File 'app/models/spree/user.rb', line 12

def password=(new_password)
  generate_spree_api_key if new_password.present? && spree_api_key.present?
  super
end