mattgibson / resque-scheduler-web

Tabs in the Resque Web gem for the Resque Scheduler plugin.
https://rubygems.org/gems/resque-scheduler-web
MIT License
25 stars 24 forks source link

Prevent crash when current_page is nil #11

Closed arussell closed 7 years ago

arussell commented 8 years ago

Currently this gem crashes when used as a Rails engine within another Rails app. The problem occurs within the pagination as the current_page variable isn't set. The full crash is:

NameError - undefined local variable or method `current_page' for #<#<Class:0x000000098b56d8>:0x00000009abdc50>:
  resque-scheduler-web (0.0.1) app/views/resque_web/plugins/resque_scheduler/delayed/_next_more.erb:7

To prevent this, I've altered the pagination partial to infer the current path from request.path if it isn't already set.

arussell commented 8 years ago

Looks like this might not actually be needed as it seems to already be fixed in 1.0.1 and I was somehow using 1.0.1.

mattgibson commented 7 years ago

Thanks for the PR :) This does indeed seem to have been fixed in 1.0.1, so I'l close this.