Convert models to use new search includes mechanism
This commit is contained in:
@@ -26,7 +26,7 @@ class IpBan < ApplicationRecord
|
||||
|
||||
def self.search(params)
|
||||
q = super
|
||||
q = q.search_attributes(params, :creator, :reason)
|
||||
q = q.search_attributes(params, :reason)
|
||||
|
||||
if params[:ip_addr].present?
|
||||
q = q.where("ip_addr = ?", params[:ip_addr])
|
||||
@@ -77,6 +77,10 @@ class IpBan < ApplicationRecord
|
||||
super(ip_addr.strip)
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:creator]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:creator]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user