Hi Benjamin
The idea behind yaml serialisation of the attributes is simplicity.
Anything that is serializable by yaml can be stored as an document
attribute, be it simple objects like strings and dates or complex
objects like an active record object or even a collection of complex
objects. And I can restore the object using YAML::load (see
DocumentBlueprint#accessors_module). In the case of active record or
datamapper objects, I'm serializing the attributes hash only.
However, if you want to sort by a date or query a date range, a date
should be stored as a string in the format "yyyymmdd". My idea is
this:
- add an optional type parameter for blueprints, like
'blueprint.attribute :date_of_birth, :as => :date'
- store dates as strings in the format "yyyymmdd"
- support range processors
So, to your questions:
1: I will have to add type support for attributes (see above)
2: See above
3: I will look into this - didn't know it's case sensitive right
now ;-)
4: See above
If you want to help me, I will happily accept pull requests. All I'm
asking for is clean and well tested code.
Regards,
Gernot