-
Notifications
You must be signed in to change notification settings - Fork 356
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 scope instead of a query to get soft-deleted items #1462
Use scope instead of a query to get soft-deleted items #1462
Conversation
There is also some controllers testing |
@cben nice catch, yes, it's best to use 1 scope (there is also a perf impact, since deleted is indexed and deleted_on is not) instead of |
Use scope instead of a query to get soft-deleted items. The rule of thumb should be to never do specific queries and rather move the logic to the models.
Use named scope instead of a custom query
Rename :not_deleted scope to :active
dd4630a
to
b1ac6cb
Compare
Checked commits Ladas/manageiq-ui-classic@aabe976~...b1ac6cb with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@miq-bot remove_label wip, pending core |
@cben can you give me a last review on this? The dependency was merged |
LGTM 👍 |
ping @martinpovolny this is 👍 from containers side, can someone review/merge? @Ladas can you toggle travis, |
Depends on:
Use scope instead of a query to get soft-deleted items. The rule
of thumb should be to never do specific queries and rather
move the logic to the models.