Class: Mongoid::Fields::Localized
- Inherits:
-
Standard
- Object
- Standard
- Mongoid::Fields::Localized
- Defined in:
- lib/custom_fields/extensions/mongoid/fields/localized.rb
Overview
The behaviour of the Localized fields in the custom fields gem is different because we do not rely on I18n directly but on a slight version Mongoid::Fields::I18n. The main reason is only practical to handle the following case: -> Back-office in English and editing content in French.
TODO: use this gem instead github.com/simi/mongoid-localizer
Instance Method Summary collapse
Instance Method Details
#mongoize(object) ⇒ Object
13 14 15 |
# File 'lib/custom_fields/extensions/mongoid/fields/localized.rb', line 13 def mongoize(object) { locale.to_s => type.mongoize(object) } end |