Veraticus/Dynamoid — pull request #34 by afrojas (2012-05-02 23:39:50+00:00)
Title: Specifying a serializer for :serialized fields

If you specify a serializer in the options hash of the field method, you can control how fields get serialized.

class User
include Dynamoid::Document

field :name
field :email
field :rank, :integer
field :number, :float
field :joined_at, :datetime
field :hash, :serialized, :serializer => Base64Serializer

end

As long as the serializer class responds to the class methods #load and #dump, it will work fine.

If nothing is specified, it fallbacks to YAML.

Keep in mind the DynamoDB only supports UTF-8 strings, so be sure your serializer returns strings.