Skip to content

Commit

Permalink
removed overridden method and undefined instance variable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Apr 28, 2019
1 parent aa1aad9 commit ae3e4bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pagy/extras/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Frontend

Pagy::I18n.clear.instance_eval { undef :load; undef :t } # unload the pagy default constant for efficiency

# no :pagy_without_i18n alias with the i18n gem
alias :pagy_without_i18n :pagy_t
def pagy_t_with_i18n(*args) ::I18n.t(*args) end
alias :pagy_t :pagy_t_with_i18n

Expand Down
2 changes: 1 addition & 1 deletion lib/pagy/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ 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
def pagy_t(path, vars={}) Pagy::I18n.t(@pagy_locale||=nil, path, vars) end

end
end

0 comments on commit ae3e4bc

Please sign in to comment.