diff options
author | pocke <p.ck.t22@gmail.com> | 2015-01-06 21:56:39 +0900 |
---|---|---|
committer | pocke <p.ck.t22@gmail.com> | 2015-01-06 22:27:54 +0900 |
commit | 0599bfa2bc49c885fd4ec3ab7ecce37dc5c03ce5 (patch) | |
tree | dd4f1c93102aafea14b602af5437c0600032374c /actionpack/lib/action_dispatch/journey/nodes/node.rb | |
parent | de4f40826e3b979735e4f3287725f1a7a3820818 (diff) | |
download | rails-0599bfa2bc49c885fd4ec3ab7ecce37dc5c03ce5.tar.gz rails-0599bfa2bc49c885fd4ec3ab7ecce37dc5c03ce5.tar.bz2 rails-0599bfa2bc49c885fd4ec3ab7ecce37dc5c03ce5.zip |
DateTime#<=> return nil when compare to the invalid String as Time.
before:
p Time.now == 'a' # => false
p Time.now <=> 'a' # => nil
require 'active_support'
require 'active_support/core_ext'
p Time.now == 'a' # => false
p Time.now <=> 'a' # => invalid date (ArgumentError)
and on ruby 2.2, Time.now == 'a' warning.
warning: Comparable#== will no more rescue exceptions of #<=> in the next release.
warning: Return nil in #<=> if the comparison is inappropriate or avoid such comparison.
after:
- Error handling.
- Quiet warnings.
Diffstat (limited to 'actionpack/lib/action_dispatch/journey/nodes/node.rb')
0 files changed, 0 insertions, 0 deletions