-
Notifications
You must be signed in to change notification settings - Fork 0
Delete a BountyClaim
Cory Boyd edited this page May 30, 2014
·
2 revisions
Delete a bounty claim
issue = Issue.find(821015)
bounty_claim = issue.bounty_claims.find(301)-
Delete events
# Gross relation name bounty_claim.bounty_claim_events.each(&:delete)
-
Delete responses
bounty_claim.bounty_claim_responses.each(&:delete)
-
Delete Transaction if bounty claim was collected
# Find the bounty claim payout transaction and delete transaction = Transaction.find(123456) transaction.delete
Then you need to update the bounty total of the Issue
issue.update_bounty_total
-
Update Issue paid out flag if necessary
if bounty_claim.collected? && issue.paid_out? issue.update_attribute(:paid_out, false) end
-
KILL IT WITH FIRE
bounty_claim.delete