Module: Spree::Admin::AdjustmentsHelper

Defined in:
app/helpers/spree/admin/adjustments_helper.rb

Instance Method Summary collapse

Instance Method Details

#adjustment_state(adjustment) ⇒ Object



4
5
6
7
# File 'app/helpers/spree/admin/adjustments_helper.rb', line 4

def adjustment_state(adjustment)
  icon = adjustment.finalized? ? 'lock' : 'unlock'
  (:span, '', class: "fa fa-#{icon}")
end

#display_adjustable(adjustable) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/spree/admin/adjustments_helper.rb', line 9

def display_adjustable(adjustable)
  case adjustable
  when Spree::LineItem
      display_line_item(adjustable)
  when Spree::Shipment
      display_shipment(adjustable)
  when Spree::Order
      display_order(adjustable)
  end
end