Hi, I have a model with a serialized field ''other_data''. How can I add raw YAML data to that field? If i try: model[other_data] = yaml_formatted_data yaml_formatted_data gets YAML formatted again. -- cheers, M. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Marcelo Barbudas wrote:> I have a model with a serialized field ''other_data''. > > How can I add raw YAML data to that field? > > If i try: > model[other_data] = yaml_formatted_data > yaml_formatted_data gets YAML formatted again.I''m not sure why you don''t want the serializer to do it for you. You could also try model.other_data = YAML::load(yaml_formatted_data)... But try model.attributes[:other_data]! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---