Module: SpreeCmCommissioner::AdjustmentDecorator

Defined in:
app/models/spree_cm_commissioner/adjustment_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



3
4
5
6
7
# File 'app/models/spree_cm_commissioner/adjustment_decorator.rb', line 3

def self.prepended(base)
  base.belongs_to :payable, polymorphic: true, optional: true

  base.whitelisted_ransackable_attributes |= %w[payable_id]
end

Instance Method Details

#display_negative_amountObject



9
10
11
# File 'app/models/spree_cm_commissioner/adjustment_decorator.rb', line 9

def display_negative_amount
  "#{amount} #{Money::Currency.find(currency).symbol}"
end