Skip to content
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

Use none instead of false query #906

Merged
merged 1 commit into from
Jul 29, 2018
Merged

Use none instead of false query #906

merged 1 commit into from
Jul 29, 2018

Conversation

gssbzn
Copy link
Contributor

@gssbzn gssbzn commented Jul 9, 2018

None allows the use a null object pattern, this prevent doing further queries to the database knowing they'll always return false

Originally

posts = Post.tagged_with.recent

Would still generate queries to the database
with this change Rails would always return a chainable NullObject that avoids doing further queries tothe database

@seuros
Copy link
Collaborator

seuros commented Jul 28, 2018

Thank you, that was legacy code.

Can you update the changelog ?

None allows the use of a null object pattern, this avoids doing further queries to the database knowing they'll always return false
@gssbzn
Copy link
Contributor Author

gssbzn commented Jul 28, 2018

@seuros updated 👍

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.

2 participants