Class: Spree::ReturnReason

Inherits:
Object
  • Object
show all
Includes:
NamedType
Defined in:
app/models/spree/return_reason.rb

Overview

Why a customer is sending items back — "wrong size", "changed mind", "not as described". Shared by returns and exchanges.

Renamed from Spree::ReturnAuthorizationReason in 6.0 now that the ReturnAuthorization chain is gone; Spree::ReturnAuthorizationReason remains as a deprecated alias until 6.3.

Instance Method Summary collapse

Instance Method Details

#can_be_deleted? ⇒ Boolean

Mirrors what dependent: :restrict_with_error enforces, so the dashboard can hide the delete control rather than offer one the model will refuse.

Returns:

  • (Boolean)


22
23
24
# File 'app/models/spree/return_reason.rb', line 22

def can_be_deleted?
  !returns.exists? && !exchanges.exists?
end