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)


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

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

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


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

def admin?
  has_spree_role?('admin')
end

#confirmed?Boolean

Returns:

  • (Boolean)


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

def confirmed?
  !!confirmed_at
end

#password=(new_password) ⇒ Object



14
15
16
17
# File 'app/models/spree/user.rb', line 14

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