to_date in activesupport does not handle invalid dates #3088

Closed
agios opened this Issue Sep 21, 2011 · 1 comment

Projects

None yet

3 participants

@agios
agios commented Sep 21, 2011

The code in core_ext/string/conversions.rb:45 will result in throwing "NoMethodError - undefined method `<' for nil:NilClass:" if given an invalid date. Should it return nil or maybe throw something like ArgumentError?

@dmathieu
Contributor

This is actually an error in ruby, not rails.
It can, however, be fixed in rails. And has the advantage of fixing it in every version of ruby.

I've fixed it in #3097, waiting to be merged.

@drogus drogus closed this Mar 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment