Bug #4868
closedActiveSupport::JSON.decode Fails Decoding Date/Time String
Description
Issuing the command...
ActiveSupport::JSON.decode('[{"created_at":"2011-06-10T18:09:09-04:00"}]')
using the rails console results in the following error...
Psych::SyntaxError: couldn't parse YAML at line 1 column 30
from /Users/tboilard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:148:in parse'
from /Users/tboilard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:148:inparse_stream'
from /Users/tboilard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:119:in parse'
from /Users/tboilard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:106:inload'
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/activesupport-3.0.7/lib/active_support/json/backends/yaml.rb:15:in decode'
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/activesupport-3.0.7/lib/active_support/json/decoding.rb:14:indecode'
from (irb):46
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/railties-3.0.7/lib/rails/commands/console.rb:44:in start'
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/railties-3.0.7/lib/rails/commands/console.rb:8:instart'
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/railties-3.0.7/lib/rails/commands.rb:23:in <top (required)>'
from script/rails:6:inrequire'
from script/rails:6:in `'
Running Rails 3.0.7 and ruby-1.9.2-p180.
Issue was discovered while updating a rails 2.3.11 app to rails 3.
Please let me know if you need any other information.
Thanks
Tom