Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflicts with will_paginate #22

Closed
gucki opened this issue Oct 4, 2011 · 8 comments
Closed

conflicts with will_paginate #22

gucki opened this issue Oct 4, 2011 · 8 comments

Comments

@gucki
Copy link

gucki commented Oct 4, 2011

Using latest ruby-units and will_paginate (with rails) an exception is always thrown when trying to render the pagination.

ActionView::Template::Error in MailingsController#index
    'previous_label' Unit not recognized

Backtrace

ruby-units (1.3.1) lib/ruby_units/unit.rb:1228:in `parse'
ruby-units (1.3.1) lib/ruby_units/unit.rb:243:in `initialize'
ruby-units (1.3.1) lib/ruby_units/string.rb:5:in `new'
ruby-units (1.3.1) lib/ruby_units/string.rb:5:in `to_unit'
ruby-units (1.3.1) lib/ruby_units/string.rb:65:in `to'
activesupport (3.1.1.rc2) lib/active_support/core_ext/string/access.rb:85:in `first'
actionpack (3.1.1.rc2) lib/action_view/helpers/translation_helper.rb:65:in `scope_key_by_partial'
actionpack (3.1.1.rc2) lib/action_view/helpers/translation_helper.rb:48:in `translate'
will_paginate (3.0.2) lib/will_paginate/view_helpers/action_view.rb:83:in `will_paginate_translate'
will_paginate (3.0.2) lib/will_paginate/view_helpers.rb:78:in `will_paginate'
will_paginate (3.0.2) lib/will_paginate/view_helpers/action_view.rb:33:in `will_paginate'
....
@gucki
Copy link
Author

gucki commented Oct 4, 2011

Filled an issue here too: mislav/will_paginate#190

@mislav
Copy link

mislav commented Oct 4, 2011

Seems like ActionPack chokes in scope_key_by_partial because of the way ruby-units implements the String#to method. ActiveSupport probably expects #to to behave in a different way.

I think ruby-units is too liberal in extending the String class.

@olbrich
Copy link
Owner

olbrich commented Oct 10, 2011

Yeah, I've been regretting that for a while now.

@gucki
Copy link
Author

gucki commented Oct 14, 2011

@olbrich Any plans on improving this? Otherwise it's barely usable with rails... :-(

@mislav
Copy link

mislav commented Oct 14, 2011

I don't know the cause of exact error but I gave a pretty good hint above. If you're using this lib, you might want to debug to find out the exact cause of the error and monkeypatch it. It shouldn't be too hard

@olbrich
Copy link
Owner

olbrich commented Oct 14, 2011

Yeah, I'm looking into fixing it this weekend.

@olbrich
Copy link
Owner

olbrich commented Oct 17, 2011

This should be mitigated with the new 1.3.2.a pre-release gem. I've removed a lot of the helpers and pushed them into a file that is not automatically required. I'll probably remove them completely in a future release. Let me know if it works better as I have not had a chance to use the new pre-release gem with an actual rails application yet. I'll release it for real after I'm sure that it will work.

@olbrich
Copy link
Owner

olbrich commented Nov 21, 2011

fixed #22 in 1.3.2

@olbrich olbrich closed this as completed Nov 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants