Skip to content

Commit

Permalink
Ransack.search is deprecated. Use .ransack instead
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorsmari committed May 8, 2021
1 parent a4d6e69 commit 4aa051a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/services/permissions/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def editable_line_items
def filtered_orders(orders)
return orders unless filter_orders?

orders.complete.not_state(:canceled).search(search_params).result
orders.complete.not_state(:canceled).ransack(search_params).result
end

def filter_orders?
Expand Down
2 changes: 1 addition & 1 deletion lib/open_food_network/order_and_distributor_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def header
def search
@permissions.visible_orders.select("DISTINCT spree_orders.*").
complete.not_state(:canceled).
search(@params[:q])
ransack(@params[:q])
end

def table
Expand Down
2 changes: 1 addition & 1 deletion lib/open_food_network/order_cycle_management_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def search
not_state(:canceled).
distributed_by_user(@user).
managed_by(@user).
search(params[:q])
ransack(params[:q])
end

def orders
Expand Down
2 changes: 1 addition & 1 deletion lib/open_food_network/payments_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def header
end

def search
Spree::Order.complete.not_state(:canceled).managed_by(@user).search(params[:q])
Spree::Order.complete.not_state(:canceled).managed_by(@user).ransack(params[:q])
end

def table_items
Expand Down
2 changes: 1 addition & 1 deletion lib/open_food_network/reports/line_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def list(line_item_includes = nil)
attr_reader :orders_relation, :order_permissions

def search_orders
orders_relation.search(@params[:q])
orders_relation.ransack(@params[:q])
end

# From the line_items given, returns the ones that are editable by the user
Expand Down
2 changes: 1 addition & 1 deletion lib/open_food_network/xero_invoices_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def header

def search
permissions = ::Permissions::Order.new(@user)
permissions.editable_orders.complete.not_state(:canceled).search(@opts[:q])
permissions.editable_orders.complete.not_state(:canceled).ransack(@opts[:q])
end

def orders
Expand Down

0 comments on commit 4aa051a

Please sign in to comment.