Skip to content

Commit

Permalink
@pagy_locale explicitly initialized to avoid warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Oct 21, 2020
1 parent 261c6a1 commit 2ef08a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pagy/frontend.rb
Expand Up @@ -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

0 comments on commit 2ef08a9

Please sign in to comment.