Class: Spree::ClaimReason

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

Overview

Why a customer raised a claim — "arrived damaged", "never arrived", "wrong item sent". A different vocabulary from ReturnReason: a claim is about something the merchant got wrong, not about a customer changing their mind.

Instance Method Summary collapse

Methods included from Metadata

#private_metadata, #private_metadata=

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)


20
21
22
# File 'app/models/spree/claim_reason.rb', line 20

def can_be_deleted?
  !claims.exists?
end