From 734739d97c830c6f1dda593e1762f2fb048d67b5 Mon Sep 17 00:00:00 2001 From: Rohit Kumar Date: Mon, 20 Mar 2023 19:46:49 +0530 Subject: [PATCH 1/2] Rail 7 compat --- lib/smart_listing.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smart_listing.rb b/lib/smart_listing.rb index 329fd12..2cc579a 100644 --- a/lib/smart_listing.rb +++ b/lib/smart_listing.rb @@ -109,7 +109,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) From 7c204466b85210c14d0293920a4f79368cd88f3e Mon Sep 17 00:00:00 2001 From: Rohit Kumar Date: Thu, 5 Jan 2023 23:14:16 +0530 Subject: [PATCH 2/2] Ruby 3 compat --- app/helpers/smart_listing/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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