igorkasyanchuk / rails_db

Rails Database Viewer and SQL Query Runner
https://www.railsjazz.com/
MIT License
1.46k stars 111 forks source link

undefined method 'per' when loading datatable #43

Closed edwallitt closed 8 years ago

edwallitt commented 8 years ago

Great gem, looking forward to using it.

Having some difficulty however viewing datatables when clicking on a table in the dashboard (from left column). Running ruby 2.2.1 and rails 4.2.4 with Ransack 1.7.0

Following error is shown in the console

NoMethodError - undefined methodper' for #<#:0x007fc78c12d418>:`

Any ideas? Could it be a Ransack compatibility issue?

Cheers

igorkasyanchuk commented 8 years ago

thanks for creating issue @bbenezech could you please investigate this issue? I won't be available to do it in next 2 days or @edwallitt if you can find a solution just make a PR

edwallitt commented 8 years ago

Thanks @igorkasyanchuk and @bbenezech . I think it may be a compatibility issue with will_paginate. Commenting out the gem seems to fix the issue. I am using (will_paginate 3.0.7).

I imagine that it will be fairly common occurrence for developers to be using will_paginate so might be worth investigating a fix or mentioning in the docs.

igorkasyanchuk commented 8 years ago

@edwallitt please post full stack-trace or error, because I tried to add will_paginate (3.0.7) in dummy app and everything works. On which step it doesn't work?

igorkasyanchuk commented 8 years ago

actually I was able to reproduce this issue

igorkasyanchuk commented 8 years ago

@edwallitt could you please try this branch https://github.com/igorkasyanchuk/rails_db/tree/will_paginate_fix and see if it works for you?

edwallitt commented 8 years ago

Yes it most certainly does. Great work, and very clever solution.

igorkasyanchuk commented 8 years ago

version 1.1.1 with fix is pushed to rubygems