From 0ed95f297e55b9abffc5e4c8945a8a5e4e672cea Mon Sep 17 00:00:00 2001 From: Dennis Monsewicz Date: Mon, 19 Aug 2024 22:14:46 -0400 Subject: [PATCH] updating code in prep for Ruby v3 --- app/helpers/smart_listing/helper.rb | 2 +- lib/smart_listing.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/smart_listing/helper.rb b/app/helpers/smart_listing/helper.rb index 707554a..b36810a 100644 --- a/app/helpers/smart_listing/helper.rb +++ b/app/helpers/smart_listing/helper.rb @@ -46,7 +46,7 @@ def name def paginate options = {} if @smart_listing.collection.respond_to? :current_page - @template.paginate @smart_listing.collection, {:remote => @smart_listing.remote?, :param_name => @smart_listing.param_name(:page)}.merge(@smart_listing.kaminari_options) + @template.paginate @smart_listing.collection, **{:remote => @smart_listing.remote?, :param_name => @smart_listing.param_name(:page)}.merge(@smart_listing.kaminari_options) end end diff --git a/lib/smart_listing.rb b/lib/smart_listing.rb index f6c8c17..2534bcc 100644 --- a/lib/smart_listing.rb +++ b/lib/smart_listing.rb @@ -98,7 +98,7 @@ def setup params, cookies else # let's sort by all attributes # - @collection = @collection.order(sort_keys.collect{|s| "#{s[1]} #{@sort[s[0]]}" if @sort[s[0]]}.compact) if @sort && !@sort.empty? + @collection = @collection.order(sort_keys.collect{|s| Arel.sql("#{s[1]} #{@sort[s[0]]}") if @sort[s[0]]}.compact) if @sort && !@sort.empty? if @options[:paginate] && @per_page > 0 @collection = @collection.page(@page).per(@per_page)