Add support for chaining more search includes
- A generalized search includes function was added -- The post and user includes functions were changed to use that - A search function for polymorphic includes was added - All models are given 3 class functions to control which includes are searchable, and extra restrictions for the "has_" params
This commit is contained in:
@@ -93,6 +93,22 @@ class ApplicationRecord < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
concerning :SearchMethods do
|
||||
class_methods do
|
||||
def searchable_includes
|
||||
[]
|
||||
end
|
||||
|
||||
def model_restriction(table)
|
||||
table.project(1)
|
||||
end
|
||||
|
||||
def attribute_restriction(*)
|
||||
all
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
concerning :ActiveRecordExtensions do
|
||||
class_methods do
|
||||
def without_timeout
|
||||
|
||||
Reference in New Issue
Block a user