Class: Spree::Carton
- Inherits:
-
Base
- Object
- ActiveRecord::Base
- Base
- Spree::Carton
show all
- Defined in:
- app/models/spree/carton.rb
Instance Attribute Summary collapse
-
#suppress_email ⇒ boolean, NilClass
This accessor is used by the ‘Spree::CartonShippedMailerSubscriber` on carton creation to either send or suppress the associated carton shipped email.
Instance Method Summary
collapse
Methods inherited from Base
display_includes
#generate_permalink, #save_permalink
Instance Attribute Details
#suppress_email ⇒ boolean, NilClass
This accessor is used by the ‘Spree::CartonShippedMailerSubscriber` on carton creation to either send or suppress the associated carton shipped email.
23
24
25
|
# File 'app/models/spree/carton.rb', line 23
def suppress_email
@suppress_email
end
|
Instance Method Details
#any_exchanges? ⇒ Boolean
63
64
65
|
# File 'app/models/spree/carton.rb', line 63
def any_exchanges?
inventory_units.any?(&:original_return_item)
end
|
#display_shipped_at ⇒ Object
51
52
53
|
# File 'app/models/spree/carton.rb', line 51
def display_shipped_at
shipped_at.to_fs(:rfc822)
end
|
#manifest_for_order(order) ⇒ Object
#order_emails ⇒ Object
43
44
45
|
# File 'app/models/spree/carton.rb', line 43
def order_emails
orders.map(&:email).uniq
end
|
#order_numbers ⇒ Object
39
40
41
|
# File 'app/models/spree/carton.rb', line 39
def order_numbers
orders.map(&:number)
end
|
#shipment_numbers ⇒ Object
47
48
49
|
# File 'app/models/spree/carton.rb', line 47
def shipment_numbers
shipments.map(&:number)
end
|
#to_param ⇒ Object
31
32
33
|
# File 'app/models/spree/carton.rb', line 31
def to_param
number
end
|
#tracking_url ⇒ Object
35
36
37
|
# File 'app/models/spree/carton.rb', line 35
def tracking_url
@tracking_url ||= shipping_method.build_tracking_url(tracking)
end
|