From ad8c311774e43fb11abce40dfb7a9da6c094aa19 Mon Sep 17 00:00:00 2001
From: Domizio Demichelis
Date: Fri, 3 Aug 2018 11:31:03 +0200
Subject: [PATCH] fix for trim extra missing when current page=1
---
lib/pagy/extras/trim.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/pagy/extras/trim.rb b/lib/pagy/extras/trim.rb
index 8fc1416f9..350fc1f04 100644
--- a/lib/pagy/extras/trim.rb
+++ b/lib/pagy/extras/trim.rb
@@ -19,7 +19,7 @@ def pagy_link_proc_with_trim(pagy, link_extra='')
p1url = pagy_trim_url(url, "#{p_vars[:page_param]}=#{MARKER}")
p1 = %( (n, text=n, extra='') { start = n == 1 ? p1 : "#{a}#{n}#{b}"
+ -> (n, text=n, extra='') { start = n.to_i == 1 ? p1 : "#{a}#{n}#{b}"
"#{start}#{ if n == p_prev ; ' rel="prev"'
elsif n == p_next ; ' rel="next"'
else '' end } #{extra}>#{text}" }