I am wondering if there is something here that I do not understand, or if I encounter an error in ActiveRecord (4.1.1).
I have a database full of records with only one attribute in the JSON bit field. I take it and try to update it like this.
test = Submission.find(1)
test.update_attribute('json_data',similar_but_different_json(test.json_data))
Suppose the method similar_but_different_jsonmakes a small update for this JSON. In my case, I fix some data errors that were created by a broken form.
However, I do not get any errors, I show the commit in the console, but the data is not sent or returned true.
To really update the record, I have to do this.
test = Submission.find(1)
old_json_data = test.json_data
test.json_data = ""
test.json_data = similar_but_different_json(old_json_data)
test.save
, -, , , ActiveRecord , , . , , JSON ?