Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
28 lines (22 sloc) 0.489 kB
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
Jump to Line
Something went wrong with that request. Please try again.