How to create this MongoMapper custom data type?
- by Kapslok
I'm trying to create a custom MongoMapper data type in RoR 2.3.5 called Translatable:
class Translatable < String
def initialize(translation, culture="en")
end
def languages
end
def has_translation(culture)?
end
def self.to_mongo(value)
end
def self.from_mongo(value)
end
end
I want to be able to use it like…