100% free for Open Source, forever. Get another set of eyes on your code.

100% free for Open Source, forever. Get another set of eyes on your code.

A
 

Spree::LegacyUser

Updated more than 3 months ago.

No issues here.

Congrats! Give yourself time to reflect on your awesome coding skillz.

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

    self.table_name = 'spree_users'

    before_destroy :check_completed_orders

    attr_accessor :password
    attr_accessor :password_confirmation

    private

      def check_completed_orders
        raise Spree::Core::DestroyWithOrdersError if orders.complete.present?
      end
  end
end
15
Complexity
0
Duplication
21
Lines
1
Methods
14.9
Complexity / M
0
Churn
15
Lines of Code
15
LOC / Method