Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4046504
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:34:18+00:00 2026-05-20T13:34:18+00:00

I have some Rails 2.3.x code that I would like to run on Rails

  • 0

I have some Rails 2.3.x code that I would like to run on Rails 3.0.3, but it seems to fail in my JSON to ActiveRecord code. Here is what I do:

mymodel = MyModel.new.from_json(json_string)

I get no errors here, but my object is empty as if there was no data in my json_string, but there is. If I look at the API (http://apidock.com/rails/ActiveRecord/Serialization/from_json) then it looks to me as it is not supported in 3.x, or?

I have tried with ActiveSupport::JSON.decode, but that decodes into a hashtable of key/values it seems?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:34:19+00:00Added an answer on May 20, 2026 at 1:34 pm

    Same problem here. The culprit is https://github.com/rails/rails/commit/c1d73270717f30498f8f4d55d6695509107c2834, here is an explanation: http://www.simonecarletti.com/blog/2010/04/inside-ruby-on-rails-serializing-ruby-objects-with-json/

    The solution seems indeed to use

       @obj.attributes = ActiveSupport::JSON.decode(json)
    

    instead of “@obj.from_json(json)”. At least for ActiveRecord objects, this works for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started some rails tutorials and noticed that some of the view code
I'm working on a rails app and would like to hide away some code
I'd like to have some rails apps over different servers sharing the same session.
I am working on a rails application (I have some experience with rails). But,
I have some data that I want to store somewhere in my Rails app
Hey, i have some experience with MVC. but I'm new to rails. I'm using
I have done some work with Ruby on Rails but am still not comfortable
This seems like a classic rails situation: I want to have a my index
We have some code that must access low level windows XP os calls which
I am using Ruby on Rails 3 and I would like to know some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.