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