app/controllers/administrate/application_controller.rb in administrate-0.10.0 vs app/controllers/administrate/application_controller.rb in administrate-0.11.0

- old
+ new

@@ -99,11 +99,14 @@ def records_per_page params[:per_page] || 20 end def order - @order ||= Administrate::Order.new(params[:order], params[:direction]) + @order ||= Administrate::Order.new( + params.fetch(resource_name, {}).fetch(:order, nil), + params.fetch(resource_name, {}).fetch(:direction, nil), + ) end def dashboard @dashboard ||= dashboard_class.new end @@ -163,10 +166,10 @@ ) end def show_search_bar? dashboard.attribute_types_for( - dashboard.collection_attributes, + dashboard.all_attributes, ).any? { |_name, attribute| attribute.searchable? } end def show_action?(_action, _resource) true