Sha256: 43583a5a3956067fad15e657fac6136cc4916418a3a75bc707a6fd03fab2e7b7

Contents?: true

Size: 586 Bytes

Versions: 32

Compression:

Stored size: 586 Bytes

Contents

module Spree
  # Default implementation of User.
  #
  # @note This class is intended to be modified by extensions (ex.
  #   spree_auth_devise)
  class LegacyUser < Spree::Base
    include UserMethods

    self.table_name = 'spree_users'

    before_destroy :check_completed_orders

    def self.model_name
      ActiveModel::Name.new Spree::LegacyUser, Spree, 'user'
    end

    attr_accessor :password
    attr_accessor :password_confirmation

    private

    def check_completed_orders
      raise Spree::Core::DestroyWithOrdersError if orders.complete.present?
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
solidus_core-2.3.1 app/models/spree/legacy_user.rb
solidus_core-2.2.2 app/models/spree/legacy_user.rb
solidus_core-2.1.1 app/models/spree/legacy_user.rb
solidus_core-2.0.3 app/models/spree/legacy_user.rb
solidus_core-1.4.2 app/models/spree/legacy_user.rb
solidus_core-1.3.2 app/models/spree/legacy_user.rb
solidus_core-2.3.0 app/models/spree/legacy_user.rb
solidus_core-2.3.0.rc3 app/models/spree/legacy_user.rb
solidus_core-2.3.0.rc2 app/models/spree/legacy_user.rb
solidus_core-2.3.0.rc1 app/models/spree/legacy_user.rb
solidus_core-2.3.0.beta1 app/models/spree/legacy_user.rb
solidus_core-2.0.2 app/models/spree/legacy_user.rb
solidus_core-1.4.1 app/models/spree/legacy_user.rb
solidus_core-2.2.1 app/models/spree/legacy_user.rb
solidus_core-2.2.0 app/models/spree/legacy_user.rb
solidus_core-2.2.0.rc1 app/models/spree/legacy_user.rb
solidus_core-2.2.0.beta1 app/models/spree/legacy_user.rb
solidus_core-2.1.0 app/models/spree/legacy_user.rb
solidus_core-2.1.0.rc1 app/models/spree/legacy_user.rb
solidus_core-2.0.1 app/models/spree/legacy_user.rb