This project is archived and is in readonly mode.

#1544 ✓invalid
jc-denton

Rails 2.1.2 from_json broken?

Reported by jc-denton | December 10th, 2008 @ 11:16 AM | in 2.x

I can't call the from_json method on any ActiveRecord object, no matter what the passed string is. I tested this on windows and on linux with Rails 2.1.2 and it failed, so I think it's probably broken.. Please provide a workaround.

$ script/generate model Blah title:string description:text $ rake db:migrate

blah = Blah.new => #blah.from_json('asdf') NoMethodError: undefined method stringify_keys!' for [asdf](String)

from /var/lib/gems/1.8/gems/activerecord-2.1.2/lib/active_record/base.rb:2366:in `attributes='
from /var/lib/gems/1.8/gems/activerecord-2.1.2/lib/active_record/serializers/json_serializer.rb:64:in `from_json'
from (irb):3

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Tags

Pages