Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Chopt make order ahead orders not reorderable
chopt_location_ids = [
5652,
6397,
6646,
6647,
6648,
6650,
6651,
6652,
6653,
6654,
7169,
7170,
7453,
7454,
7624,
7625,
7626,
7627,
7628,
7629,
7630,
7631,
7632,
7633,
8015,
8482,
10153,
10619,
10620,
10823,
10824,
11457,
11560,
14504,
14505,
14820,
15323,
17342,
22070,
22074,
22100,
22101
]
chopt_location_ids.each do |location_id|
orders = Order.where("location_id=?",location_id)
orders.find_each do |order|
if (order.reorderable) && (order.state = 'completed')
puts order.id
order.update_attribute(:reorderable, false)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment