Class: Spree::LegacyUser

Inherits:
Object
  • Object
show all
Includes:
UserAddress, UserMethods, UserPaymentSource
Defined in:
app/models/spree/legacy_user.rb

Constant Summary

Constants included from PrefixedId

PrefixedId::SQIDS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UserMethods

#available_store_credits, #can_be_deleted?, #default_wishlist_for_store, #event_prefix, #event_serializer_class, #full_name, #last_incomplete_spree_order, #to_csv, #total_available_store_credit

Methods included from Publishable

#event_context, #event_payload, #event_prefix, #event_serializer_class, #publish_event

Methods included from UserReporting

#amount_spent_in, #average_order_value, #completed_orders_for_store, #display_amount_spent_in, #lifetime_value, #order_count, #report_values_for

Methods included from DisplayMoney

#money_methods

Methods included from Metadata

#metadata, #metadata=, #public_metadata=

Methods included from PrefixedId

#prefixed_id, #to_param

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



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

def password
  @password
end

#password_confirmationObject

Returns the value of attribute password_confirmation.



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

def password_confirmation
  @password_confirmation
end

Instance Method Details

#valid_password?(check_password) ⇒ Boolean

Simple password validation for testing purposes In production, Spree.user_class should be overridden with a proper auth solution (e.g., Devise)

Returns:



21
22
23
24
25
# File 'app/models/spree/legacy_user.rb', line 21

def valid_password?(check_password)
  return false if encrypted_password.blank?

  BCrypt::Password.new(encrypted_password) == check_password
end