Created
May 1, 2014 12:58
-
-
Save peterberkenbosch/7f2f5a3bfd7c23bdfb2e to your computer and use it in GitHub Desktop.
Customize the serializer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/serializers/my_shipment_serializer.rb | |
class MyShipmentSerializer < Spree::Hub::ShipmentSerializer | |
attributes :order_token | |
def order_token | |
object.order.token | |
end | |
end | |
# app/models/spree/shipment_decorator.rb | |
Spree::Shipment.hub_serializer = "MyShipmentSerializer" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment