Skip to content

Instantly share code, notes, and snippets.

@avidas
Created December 26, 2017 21:30
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 avidas/eb23eba616ff93b9ebedb92fa71f6548 to your computer and use it in GitHub Desktop.
Save avidas/eb23eba616ff93b9ebedb92fa71f6548 to your computer and use it in GitHub Desktop.
begin
def cancel_price_escalation(account, location)
TenantService.switch_tenant_with_location_uuid(location.uuid)
prs = account.primary_reservations.active.select { |res| res.location_id == location.id }
prs.map{ |res| res.update_attributes(annual_escalator_rate: nil, escalation_date: nil) }
end
account = Account.find_by_short_code('1VHUN0')
raise 'Incorrect Account' unless account.name == 'UBQ'
location = Location.find(98)
raise 'Incorrect Location' unless location.name == 'Ibn Gabirol'
cancel_price_escalation(account, location)
end
@jhjwind
Copy link

jhjwind commented Dec 26, 2017

👍

@ianguffy
Copy link

👍

@tyjet
Copy link

tyjet commented Dec 26, 2017

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment