diff options
author | Vipul A M <vipulnsward@gmail.com> | 2013-05-02 09:49:40 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2013-05-02 09:49:40 +0530 |
commit | 796ed59e20dc739f1c3b195692a60d8e5d97c166 (patch) | |
tree | e7db82a9f3de72e13d18d4fac0c617a1b556170f | |
parent | 2cf86936b7222ff8245d37b656c8ddc621ae52ea (diff) | |
download | rails-796ed59e20dc739f1c3b195692a60d8e5d97c166.tar.gz rails-796ed59e20dc739f1c3b195692a60d8e5d97c166.tar.bz2 rails-796ed59e20dc739f1c3b195692a60d8e5d97c166.zip |
document String#to_time exception
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/conversions.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/conversions.rb b/activesupport/lib/active_support/core_ext/string/conversions.rb index d2a2db32bb..6691fc0995 100644 --- a/activesupport/lib/active_support/core_ext/string/conversions.rb +++ b/activesupport/lib/active_support/core_ext/string/conversions.rb @@ -15,6 +15,7 @@ class String # "2012-12-13 06:12".to_time # => 2012-12-13 06:12:00 +0100 # "2012-12-13T06:12".to_time # => 2012-12-13 06:12:00 +0100 # "2012-12-13T06:12".to_time(:utc) # => 2012-12-13 05:12:00 UTC + # "12/13/2012".to_time # => ArgumentError: argument out of range def to_time(form = :local) parts = Date._parse(self, false) return if parts.empty? |