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

to_date in activesupport does not handle invalid dates #3088

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

to_date in activesupport does not handle invalid dates #3088

agios opened this issue Sep 21, 2011 · 1 comment

Comments

@agios
Copy link

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
Copy link
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 as completed Mar 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants