Sha256: 62acfe65faf97d2442e3477e7e79fb1b8f222a749f04c0fcfefd56e93fe9d40e

Contents?: true

Size: 388 Bytes

Versions: 8

Compression:

Stored size: 388 Bytes

Contents

# frozen_string_literal: true

class Spree::StoreCreditReason < Spree::Base
  scope :active, -> { where(active: true) }
  default_scope -> { order(arel_table[:name].lower) }

  validates :name, presence: true, uniqueness: { case_sensitive: false, allow_blank: true }

  has_many :store_credit_events, inverse_of: :store_credit_reason

  self.allowed_ransackable_attributes = %w[name]
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
solidus_core-4.4.2 app/models/spree/store_credit_reason.rb
solidus_core-4.4.1 app/models/spree/store_credit_reason.rb
solidus_core-4.4.0 app/models/spree/store_credit_reason.rb
solidus_core-4.3.4 app/models/spree/store_credit_reason.rb
solidus_core-4.3.3 app/models/spree/store_credit_reason.rb
solidus_core-4.3.2 app/models/spree/store_credit_reason.rb
solidus_core-4.3.1 app/models/spree/store_credit_reason.rb
solidus_core-4.3.0 app/models/spree/store_credit_reason.rb