Skip to content

Instantly share code, notes, and snippets.

@prokop75
Created November 10, 2016 20:39
Show Gist options
  • Save prokop75/a1e141c10b828d03ae74aca3f06e06e4 to your computer and use it in GitHub Desktop.
Save prokop75/a1e141c10b828d03ae74aca3f06e06e4 to your computer and use it in GitHub Desktop.
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