From 2ef08a979aaed6e0d1b3ec7e910ea38eaaf4cd61 Mon Sep 17 00:00:00 2001
From: Domizio Demichelis
Date: Wed, 21 Oct 2020 10:14:31 +0700
Subject: [PATCH] @pagy_locale explicitly initialized to avoid warning
---
lib/pagy/frontend.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/pagy/frontend.rb b/lib/pagy/frontend.rb
index 84b9b9a14..e1a6c1b76 100644
--- a/lib/pagy/frontend.rb
+++ b/lib/pagy/frontend.rb
@@ -68,7 +68,8 @@ def pagy_link_proc(pagy, link_extra='')
end
# Similar to I18n.t: just ~18x faster using ~10x less memory
- def pagy_t(path, vars={}) Pagy::I18n.t(@pagy_locale, path, vars) end
+ # (@pagy_locale explicitly initilized in order to avoid warning)
+ def pagy_t(path, vars={}) Pagy::I18n.t(@pagy_locale||=nil, path, vars) end
end
end