Class: Spree::User

Inherits:
Base
  • Object
show all
Includes:
Discard::Model, ParanoiaDeprecations, SoftDeletable, UserMethods
Defined in:
app/models/spree/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.admin_created?Boolean

Returns:

  • (Boolean)


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

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

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/spree/user.rb', line 37

def admin?
  has_spree_role?('admin')
end

#confirmed?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/spree/user.rb', line 41

def confirmed?
  !!confirmed_at
end

#password=(new_password) ⇒ Object



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

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