Skip to content

Conversation

@korstiaan
Copy link
Member

We have a default scope on our model, which filters out non published posts. This resulted in WpCache.create_or_update trying to insert the same (unpublished) wp_id multiple times because where(wp_id: wp_id) didn't return this unpublished post.

@Marthyn
Copy link
Member

Marthyn commented Jun 17, 2015

we shouldn't use a default scope anyways i think. And make a published scope and use where needed. Much more descriptive and you dont need to use unscoped.
http://rails-bestpractices.com/posts/2013/06/15/default_scope-is-evil/

Copy link
Contributor

Choose a reason for hiding this comment

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

We should DRY this up a bit 🍶

@dunyakirkali dunyakirkali added this to the V1.1.0 milestone Jun 17, 2015
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.

5 participants