app/controllers/administrate/application_controller.rb in administrate-0.11.0 vs app/controllers/administrate/application_controller.rb in administrate-0.12.0
- old
+ new
@@ -5,11 +5,11 @@
def index
search_term = params[:search].to_s.strip
resources = Administrate::Search.new(scoped_resource,
dashboard_class,
search_term).run
- resources = apply_resource_includes(resources)
+ resources = apply_collection_includes(resources)
resources = order.apply(resources)
resources = resources.page(params[:page]).per(records_per_page)
page = Administrate::Page::Collection.new(dashboard, order: order)
render locals: {
@@ -123,11 +123,11 @@
def scoped_resource
resource_class.default_scoped
end
- def apply_resource_includes(relation)
- resource_includes = dashboard.association_includes
+ def apply_collection_includes(relation)
+ resource_includes = dashboard.collection_includes
return relation if resource_includes.empty?
relation.includes(*resource_includes)
end
def resource_params