Skip to content

Commit

Permalink
each_page returns Enumerator unless block_given
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Apr 17, 2011
1 parent 2cc02d8 commit f23655c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/kaminari/helpers/paginator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def render(&block)

# enumerate each page providing PageProxy object as the block parameter
def each_page
return to_enum(:each_page) unless block_given?

1.upto(@options[:num_pages]) do |i|
yield PageProxy.new(@window_options.merge(@options), i, @last)
end
Expand Down

0 comments on commit f23655c

Please sign in to comment.