I have a model that uses a serialized column:
class Form < ActiveRecord::Base
serialize :options, Hash
end
有没有办法让这种序列化使用JSON而不是YAML?
I have a model that uses a serialized column:
class Form < ActiveRecord::Base
serialize :options, Hash
end
有没有办法让这种序列化使用JSON而不是YAML?
在Rails 3.1中,您可以
class Form < ActiveRecord::Base
serialize :column, JSON
end
Hope that helps