diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-08-13 23:56:37 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-08-13 23:56:37 -0700 |
commit | 2df6d7141b294723190c2356a5227834ba6fdfcb (patch) | |
tree | a7a21c321ce9a42ba764bbd36e7c8ba2b94032cc /guides | |
parent | 4934f19a7812b08a369c775c724410057daeb151 (diff) | |
parent | 4400fec234e3272f2be6e0ccd609fa335c1f7465 (diff) | |
download | rails-2df6d7141b294723190c2356a5227834ba6fdfcb.tar.gz rails-2df6d7141b294723190c2356a5227834ba6fdfcb.tar.bz2 rails-2df6d7141b294723190c2356a5227834ba6fdfcb.zip |
Merge pull request #11756 from zilkey/master
added String#to_date documentation to Rails 4 upgrade guide [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/4_0_release_notes.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/guides/source/4_0_release_notes.md b/guides/source/4_0_release_notes.md index 8be7a86d20..ff4d30b4c0 100644 --- a/guides/source/4_0_release_notes.md +++ b/guides/source/4_0_release_notes.md @@ -173,6 +173,19 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/master/activ * `Object#try` will now return nil instead of raise a NoMethodError if the receiving object does not implement the method, but you can still get the old behavior by using the new `Object#try!`. +* `String#to_date` now raises `Argument Error: invalid date` instead of `NoMethodError: undefined method 'div' for nil:NilClass` + when given an invalid date. It is now the same as `Date.parse`, and it accepts more invalid dates than 3.x, such as: + + ``` + # ActiveSupport 3.x + "asdf".to_date # => NoMethodError: undefined method `div' for nil:NilClass + "333".to_date # => NoMethodError: undefined method `div' for nil:NilClass + + # ActiveSupport 4 + "asdf".to_date # => ArgumentError: invalid date + "333".to_date # => Fri, 29 Nov 2013 + ``` + ### Deprecations * Deprecate `ActiveSupport::TestCase#pending` method, use `skip` from MiniTest instead. |