Last active
August 14, 2017 21:21
-
-
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
This file contains hidden or 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
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Splitting up https://gist.github.com/avidas/a3d454a33ff3e1446aae50ee9c800926 into two scripts.