Last active
November 15, 2018 19:10
-
-
Save vannio/5320fa62c9cc9c9b6e9d43c3a499dd50 to your computer and use it in GitHub Desktop.
Useful Eagle snippets
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
def mark_order(number, state = 'shipped') | |
o = Spree::Order.find_by(number: number) | |
o.update_attribute('shipment_state', state) | |
s = o.shipments.first | |
s.update_attribute('state', state) | |
s.update_attribute('shipped_at', s.expected_shipping_date) if state == 'shipped' | |
end | |
def mark_customisation(number, state = 'prepared') | |
o = Spree::Order.find_by(number: number) | |
o.line_items.each do |li| | |
c = li.customisation | |
c.update_attribute('state', state) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment