Created
December 27, 2017 17:38
-
-
Save avidas/886555986e656d55da86f3aaa9621639 to your computer and use it in GitHub Desktop.
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
begin | |
account = Account.find_by_short_code '7RFQTX' | |
location = Location.find_by_code 'ATL02' | |
price = account.anywhere_reservations.active.first.price | |
start_jan_date = Date.today.next_month.beginning_of_month | |
end_feb_date = Date.today.next_month.next_month.end_of_month | |
full_discount_for_two_months = { type: "discount", started_on: start_jan_date, ended_on: end_feb_date, price: -price } | |
Anywhere::ReservationService.new(account, location).apply_addon(full_discount_for_two_months) | |
end |
Do you need to switch tenant?
@jhjwind tenant switch happens when Anywhere::ReservationService is initialized with the location
๐
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
๐