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.
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.
Marcelo B. 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]!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs