Sha256: a9e57ccd3c2e756884893dd07964ac1aecaafa0d6659b33d8fc172b54e77f696

Contents?: true

Size: 489 Bytes

Versions: 34

Compression:

Stored size: 489 Bytes

Contents

module WillPaginate
  module PerPage
    def per_page
      defined?(@per_page) ? @per_page : WillPaginate.per_page
    end

    def per_page=(limit)
      @per_page = limit.to_i
    end

    def self.extended(base)
      base.extend Inheritance if base.is_a? Class
    end

    module Inheritance
      def inherited(subclass)
        super
        subclass.per_page = self.per_page
      end
    end
  end

  extend PerPage

  # default number of items per page
  self.per_page = 30
end

Version data entries

34 entries across 34 versions & 5 rubygems

Version Path
will_paginate-4.0.1 lib/will_paginate/per_page.rb
will_paginate-4.0.0 lib/will_paginate/per_page.rb
will_paginate-3.3.1 lib/will_paginate/per_page.rb
will_paginate-3.3.0 lib/will_paginate/per_page.rb
will_paginate-3.2.1 lib/will_paginate/per_page.rb
will_paginate-3.2.0 lib/will_paginate/per_page.rb
will_paginate-3.1.8 lib/will_paginate/per_page.rb
will_paginate-3.1.7 lib/will_paginate/per_page.rb
will_paginate-3.1.6 lib/will_paginate/per_page.rb
will_paginate-3.0.12 lib/will_paginate/per_page.rb
will_paginate-3.1.5 lib/will_paginate/per_page.rb
will_paginate-3.0.11 lib/will_paginate/per_page.rb
will_paginate-2.3.17 lib/will_paginate/per_page.rb
will_paginate-3.1.3 lib/will_paginate/per_page.rb
will_paginate-3.0.10 lib/will_paginate/per_page.rb
will_paginate-3.0.9 lib/will_paginate/per_page.rb
will_paginate-3.1.2 lib/will_paginate/per_page.rb
will_paginate-3.1.1 lib/will_paginate/per_page.rb
will_paginate-3.0.8 lib/will_paginate/per_page.rb
will_paginate-3.1.0 lib/will_paginate/per_page.rb