kennethkalmer/ruote-kit — pull request #23 by thunder- (2012-10-25 20:51:21+00:00)
Title: fix errors/schedules when GET without any errors/schedules available

When in the follwing screen:
http://my.domain.com/_ruote/processes/:id

there are 4 GET requests available: expressions, workitems, errors, schedules.

In case there are no errors or no schedules, clicking those links results in an Internal Sever Error.
This is caused by @limit = @count which in case of no results creates @limit = 0.

This in turn causes view/_pagination.html.haml to get a division by 0 situation on the line:
- las = ((@count / lim.to_f).ceil - 1) * lim

Proposed solution sets @skip to nil in case @count = 0 which then skips the pagination section of _pagination.html.haml and will only print 0 errors/schedules.