Skip to content

Instantly share code, notes, and snippets.

@avidas
Last active August 14, 2017 21:21
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/f7eb74e7444e33b32577b91e905927f2 to your computer and use it in GitHub Desktop.
Save avidas/f7eb74e7444e33b32577b91e905927f2 to your computer and use it in GitHub Desktop.
Cancel Move Out for Finalized SD Invoice Reservations https://jira.we.co/browse/REVENG-121
# cancel move out for office 337 in Yangping Luy for 上海唐艾文化传播有限公司 - KIB7YC
begin
Rails.logger.info "JIRA REVENG-121 starting to cancel move out for Office 337 for Gimbal EUAETK"
TenantService.switch_to_apac_tenant
reservable = Account.find_by_short_code("KIB7YC").primary_reservations.map(&:reservable).detect { |res| res.type == "Office" && res.name == "337" }
pr = Account.find_by_short_code("KIB7YC").primary_reservations.where("reservable_id = #{reservable.id}").first
pr.ended_on = nil
pr.save!
Rails.logger.info "JIRA REVENG-121 done canceling move out for Office 337 for Gimbal EUAETK "
end
@avidas
Copy link
Author

avidas commented Aug 14, 2017

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