Skip to content

destroy zombie likes when likable is invalid - Bounty 456 #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2014

Conversation

codebender
Copy link
Contributor

BUG: ActiveRecord::RecordInvalid: Validation failed: Likable can't be blank - Bounty 456

The code will now handle when the zombie like has an invalid likable 😸

@mrageh
Copy link

mrageh commented Dec 13, 2014

👍 I think you need to rerun the build

@codebender
Copy link
Contributor Author

seems like the build failed while downloading gems... oh TravisCI...

like.save!
rescue ActiveRecord::RecordNotUnique => ex
ap ex
rescue ActiveRecord::RecordNotUnique, ActiveRecord::RecordInvalid => ex
like.destroy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this line. The like was never saved, destroying it make no sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this job is the clean up zombie Likes. Zombie meaning not having the user_id set on the Like record. So we either want to assign the user_id or destroy it

@just3ws
Copy link
Contributor

just3ws commented Dec 13, 2014

Are we good on the conversation @codebender and @seuros on this PR?

 - or when a Like tracking code doesn’t associate to a user
@codebender
Copy link
Contributor Author

@seuros ok with this ^^ ?

just3ws added a commit that referenced this pull request Dec 14, 2014
destroy zombie likes when likable is invalid - Bounty 456
@just3ws just3ws merged commit 8e35408 into coderwall:master Dec 14, 2014
@seuros
Copy link
Contributor

seuros commented Dec 14, 2014

nice 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants