Sha256: a20a94ebd2ae3fa3e3e1eb83cb4de94a34ccc460a927ac6f4aacf0e106130b03

Contents?: true

Size: 528 Bytes

Versions: 8

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true

module Spree
  class RefundReason < 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 }

    RETURN_PROCESSING_REASON = 'Return processing'

    has_many :refunds

    self.allowed_ransackable_attributes = %w[name code]

    def self.return_processing_reason
      find_by!(name: RETURN_PROCESSING_REASON, mutable: false)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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