Hi all,

I'm using rails 4.1.0.beta 1 and postgresql 9.3.1 and its native support 
for json column. so no special serializer or no special storage thing with 
active record, just plain :json type in active record migration.

in my active record model, I've got two json fields.

input: {"first_name"=>"firstName", "last_name"=>"lastName", 
"postcode"=>"postcode"}
output: {"customer_detail"=>{"first_name"=>"firstName", 
"last_name"=>"lastName", "postcode"=>"postcode"}}

model.input
=> {"first_name"=>"firstName", "last_name"=>"lastName", 
"postcode"=>"postcode"}

model[:input]
=> {"first_name"=>"firstName", "last_name"=>"lastName", 
"postcode"=>"postcode"}

model.input_before_type_cast
=> "{\"first_name\":\"firstName\", \"last_name\":\"lastName\", 
\"postcode\":\"postcode\"}"

model.output 
=> nil

model[:output]
=> {"customer_detail"=>{"first_name"=>"firstName", "last_name"=>"lastName", 
"postcode"=>"postcode"}}

model.output_before_type_cast
=> 
"{\"customer_detail\":{\"first_name\":\"firstName\",\"last_name\":\"lastName\",\"postcode\":\"postcode\"}}"

could someone explain why this is happening? I'm confused why this is 
happening...

thanks!
J

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b7573b25-0652-4dc8-a61d-f8c0bc883b9b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to