GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
On a newly created app, using scaffold to create a Post resource:
Post.default_scopes # => 
Post.default_scopes? # => true
Isn't this semantically wrong? It can be misleading. Instead to get the correct result one has to do something like Post.default_scopes.any?.
It happens due to the fact that default scopes are initiated on ActiveRecord::Base using class_attributes which automatically defines the predicate method to be essentially !! in this case.
What you think? Should this be corrected? If so, I could work on a PR.
This is a side effect of using class_attributes. In my opinion this method should not exist at all. Want to open a pull request to remove it?
@rafaelfranca Sure. Will do.