I have this table in which serialized objects are stored:
class CachedObject < ActiveRecord::Base attr_accessible :key, :data validates_uniqueness_of :key end
The data column stores the serialized object indexed by the key. Pretty simple. I run this code for testing:
key = "test" obj = {"test" => "test"} row = CachedObject.find_or_create_by_key key row.data = obj.to_json row.save
The object is created, but does not save it back to the database. No error messages. What am I doing wrong here?
source share