Class: Spree::StoreCreditCategory

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/store_credit_category.rb

Constant Summary collapse

GIFT_CARD_CATEGORY_NAME =
'Gift Card'.freeze
DEFAULT_NON_EXPIRING_TYPES =
[GIFT_CARD_CATEGORY_NAME]

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

belongs_to_required_by_default, page, spree_base_scopes

Methods included from Preferences::Preferable

#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Class Method Details

.default_reimbursement_category(_options = {}) ⇒ Object


17
18
19
# File 'app/models/spree/store_credit_category.rb', line 17

def default_reimbursement_category(_options = {})
  Spree::StoreCreditCategory.first
end

Instance Method Details

#non_expiring?Boolean


8
9
10
# File 'app/models/spree/store_credit_category.rb', line 8

def non_expiring?
  non_expiring_category_types.include? name
end

#non_expiring_category_typesObject


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

def non_expiring_category_types
  DEFAULT_NON_EXPIRING_TYPES | Spree::Config[:non_expiring_credit_types]
end