Module: Spree::HasTrackingCarrier
- Extended by:
- ActiveSupport::Concern
- Included in:
- Delivery, ShippingLabel
- Defined in:
- app/models/concerns/spree/has_tracking_carrier.rb
Overview
A carrier a consignment or a label is pinned to.
The value is free text by design: Spree.tracking_carriers supplies
display names and tracking-page templates for the carriers Spree knows,
and anything else — a freight forwarder, a courier a merchant uses once —
is a legal value that simply has no entry.
Instance Method Summary collapse
-
#carrier_name ⇒ String?
The registry's display name, or the value as entered.
Instance Method Details
#carrier_name ⇒ String?
Returns the registry's display name, or the value as entered.
12 13 14 15 16 |
# File 'app/models/concerns/spree/has_tracking_carrier.rb', line 12 def carrier_name return if carrier.blank? Spree.tracking_carriers.dig(carrier, :name) || carrier end |