Skip to content

Instantly share code, notes, and snippets.

@jumph4x
Created May 9, 2012 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jumph4x/2647384 to your computer and use it in GitHub Desktop.
Save jumph4x/2647384 to your computer and use it in GitHub Desktop.
Destination Charges
Spree::Shipment.class_eval do
after_save :ensure_destination_charge
def ensure_correct_adjustment
if order.destination_charges[0]
# recalculate
else
order.destination_charges << create a new one
end
end
end
Spree::Order.class_eval do
has_many :destination_charges
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment