I'm stuck on trying to create this custom type.
Here's what I need:
The data stored in the database is a simple abbreviated string direction: 'n' or 'e' or 'se'
When you retrieve the Direction class from the database you can access a member variable in abbreviated form ('e' or 's') or long form ('east' or 'south')
For example: Direction.new('n') stores in the database as 'n', but when you access it you can do direction.abbrev is equal to 'n' or direction.long is equal to 'north'
Do you typically create a custom type with Direction.new('n') or more usually with direction: 'n'?
When I create a new Direction.new('n') the to_mongo method is called multiple times. Any idea why? Thanks.