Last active
December 29, 2017 20:11
-
-
Save avidas/6a020170564713b6e4ea436d20a0ebee to your computer and use it in GitHub Desktop.
This file contains 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 | |
TenantService.switch_to_rest_of_world_tenant | |
account = Account.find_by short_code: 'F469UC' | |
res = account.primary_reservations.active.find_by(description: 'DD - 15') | |
# need to find this way since res.commitment_term won't show a future term | |
term = CommitmentTerm.find_by(termable: res) | |
term.archive! if term.active? | |
raise 'Still has active term' if term.reload.active? | |
end |
Can you look up the reservation by UUID? It's safer.
I would also look up the CT in your console and use its uuid. You can find it by doing res.commitment_terms and it should list them all, I believe.
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍