Skip to content

Commit

Permalink
Merge pull request #21 from mguidetti/fix-item-includes-deprecation
Browse files Browse the repository at this point in the history
Change deprecated item_includes method to item_associations
  • Loading branch information
blocknotes authored Sep 10, 2023
2 parents 83d2980 + 73290fa commit 73c1fc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/administrate_ransack/searchable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def scoped_resource
@ransack_results.result(distinct: true)
end

# ref => https://github.com/thoughtbot/administrate/blob/v0.15.0/app/helpers/administrate/application_helper.rb#L54-L60
# ref => https://github.com/thoughtbot/administrate/blob/v0.18.0/app/helpers/administrate/application_helper.rb#L72-L78
def sanitized_order_params(page, current_field_name)
collection_names = page.item_includes + [current_field_name]
collection_names = page.item_associations + [current_field_name]
association_params = collection_names.map do |assoc_name|
{ assoc_name => %i[order direction page per_page] }
end
Expand Down

0 comments on commit 73c1fc3

Please sign in to comment.