-
Notifications
You must be signed in to change notification settings - Fork 896
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
Replace conditions with scope #16399
Replace conditions with scope #16399
Conversation
ce52fdd
to
6e5aa69
Compare
app/models/system_service.rb
Outdated
scope :failed_systemd_services, -> { where(:systemd_active => 'failed').or(where(:systemd_sub => 'failed')) } | ||
scope :host_service_group, ->(host_service_group_id) { where(:host_service_group_id => host_service_group_id) } | ||
scope :host_service_group_running_systemd, lambda { |host_service_group_id| | ||
running_systemd_services & host_service_group(host_service_group_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running_systemd_services.merge(host_service_group(host_service_group_id))
6e5aa69
to
b3e48e5
Compare
b3e48e5
to
122103a
Compare
122103a
to
7c377bf
Compare
Checked commit alexander-demicev@7c377bf with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@lpichler @gtanzillo Hi, can I ask for review? |
@alexander-demichev There are callers of those methods in the provider repos. Do you have additional PRs to change the callers? |
@gtanzillo I have 2 related PR's ManageIQ/manageiq-providers-openstack#144 ManageIQ/manageiq-ui-classic#2638 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@alexander-demichev @gtanzillo ManageIQ/manageiq-providers-openstack#144 depends on this PR and that's marked as |
@alexander-demichev @gtanzillo ping ^ |
@alexander-demichev @gtanzillo ping ^ @alexander-demichev We also need a BZ if this should go to |
@miq-bot add_label gaprindashvili/yes |
@simaishi hi, there is an issue in github ManageIQ/manageiq-ui-classic#2517 related to this BZ |
@alexander-demichev Change to z-stream requires a BZ to backport... |
@simaishi I'm 👍 with |
@alexander-demichev still need a BZ! |
Never mind... found BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1507916 |
Replace sql conditions with named scopes.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1507916