Convert models to use new search includes mechanism

This commit is contained in:
BrokenEagle
2020-07-19 03:42:51 +00:00
parent c141a358bd
commit c4009efccd
36 changed files with 208 additions and 125 deletions

View File

@@ -13,7 +13,7 @@ class IpAddress < ApplicationRecord
def self.search(params)
q = super
q = q.search_attributes(params, :user, :model_type, :model_id, :ip_addr)
q = q.search_attributes(params, :ip_addr)
q.order(created_at: :desc)
end
@@ -54,6 +54,10 @@ class IpAddress < ApplicationRecord
super & attributes.keys.map(&:to_sym)
end
def self.searchable_includes
[:user, :model]
end
def self.available_includes
[:user, :model]
end