Skip to content

Commit

Permalink
Always return the same object as Pagy.root (#125)
Browse files Browse the repository at this point in the history
* Update copyright notice to 2019 (#121)

* Always return the same object as Pagy.root

Co-authored-by: Domizio Demichelis <[email protected]>
  • Loading branch information
ashmaroli and ddnexus committed Feb 19, 2019
1 parent 7763977 commit 71a3e5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pagy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Pagy ; VERSION = '1.3.3'
class OverflowError < StandardError; attr_reader :pagy; def initialize(pagy) @pagy = pagy end; end

# Root pathname to get the path of Pagy files like templates or dictionaries
def self.root; Pathname.new(__FILE__).dirname end
def self.root; @root ||= Pathname.new(__FILE__).dirname.freeze end

# default vars
VARS = { page:1, items:20, outset:0, size:[1,4,4,1], page_param: :page, params:{}, anchor:'', link_extra:'', item_path:'pagy.info.item_name', cycle: false }
Expand Down

0 comments on commit 71a3e5f

Please sign in to comment.