-
Notifications
You must be signed in to change notification settings - Fork 988
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
Fixes #21602 - Add scoped_search on host.id for reports #4989
Conversation
Issues: #21602 |
app/models/report.rb
Outdated
@@ -19,6 +19,7 @@ class Report < ApplicationRecord | |||
def self.inherited(child) | |||
child.instance_eval do | |||
scoped_search :relation => :host, :on => :name, :complete_value => true, :rename => :host | |||
scoped_search :relation => :host, :on => :id, :complete_value => true, :rename => :host_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.
Why not search on the host_id
column? it would save a potentially painful join with the host table. Also, please make this only explicit.
2547e97
to
71d3620
Compare
app/models/report.rb
Outdated
@@ -27,6 +27,8 @@ def self.inherited(child) | |||
scoped_search :relation => :hostgroup, :on => :title, :complete_value => true, :rename => :hostgroup_title | |||
|
|||
scoped_search :on => :reported_at, :complete_value => true, :default_order => :desc, :rename => :reported, :only_explicit => true | |||
scoped_search :on => :host_id, :complete_value => true, :only_explicit => true | |||
|
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.
Extra empty line detected at block body end.
71d3620
to
e7c03e5
Compare
I changed to search on |
app/models/report.rb
Outdated
@@ -27,6 +27,7 @@ def self.inherited(child) | |||
scoped_search :relation => :hostgroup, :on => :title, :complete_value => true, :rename => :hostgroup_title | |||
|
|||
scoped_search :on => :reported_at, :complete_value => true, :default_order => :desc, :rename => :reported, :only_explicit => true | |||
scoped_search :on => :host_id, :complete_value => true, :only_explicit => true |
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.
e7c03e5
to
5a83399
Compare
I changed it to |
Thanks @xprazak2 |
Setting release to 1.17 |
No description provided.