Class: Uncharted::Country::Field
- Inherits:
-
Object
- Object
- Uncharted::Country::Field
- Includes:
- Mongoid::Fields::Serializable
- Defined in:
- lib/uncharted/adapters/mongoid.rb
Instance Method Summary (collapse)
Instance Method Details
- (Object) deserialize(alpha2)
10 11 12 |
# File 'lib/uncharted/adapters/mongoid.rb', line 10 def deserialize(alpha2) alpha2 && Uncharted::Country.find(alpha2) end |
- (Object) serialize(country)
14 15 16 |
# File 'lib/uncharted/adapters/mongoid.rb', line 14 def serialize(country) country && country.alpha2 end |