Current versions of rails support json serialisation out of the box. Define your field as a string (or text) in the migration and then:
class Foo < ActiveRecord::Base
serialize :field, JSON
end
bar = Foo.new
bar.field = [1,2,3]
bar.save
Current versions of rails support json serialisation out of the box. Define your field as a string (or text) in the migration and then:
class Foo < ActiveRecord::Base
serialize :field, JSON
end
bar = Foo.new
bar.field = [1,2,3]
bar.save