Module: Translator::ClassMethods
- Defined in:
- lib/translator/translator.rb
Instance Method Summary (collapse)
-
- (Object) translate_field(name)
Define the mongoId field for translations of field `name`.
-
- (Object) translate_fields(names)
Define the mongoId field for translations of fields in `names`.
Instance Method Details
- (Object) translate_field(name)
Define the mongoId field for translations of field `name`
13 14 15 16 17 |
# File 'lib/translator/translator.rb', line 13 def translate_field(name) class_eval <<-EOV field "#{name}_translations".to_sym, :type => Hash, :default => {} EOV end |
- (Object) translate_fields(names)
Define the mongoId field for translations of fields in `names`
21 22 23 24 25 |
# File 'lib/translator/translator.rb', line 21 def translate_fields(names) names.each do |name| translate_field(name) end end |