Skip to content

Instantly share code, notes, and snippets.

@avidas
Last active December 29, 2017 20:11
Show Gist options
  • Save avidas/6a020170564713b6e4ea436d20a0ebee to your computer and use it in GitHub Desktop.
Save avidas/6a020170564713b6e4ea436d20a0ebee to your computer and use it in GitHub Desktop.
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
@edohring
Copy link

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.

@edohring
Copy link

👍

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