Module: MongoODM::Document::AttributeMethods::Localization::ClassMethods

Defined in:
lib/mongo_odm/document/attribute_methods/localization.rb

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) localized_attribute?(attr_name)



20
21
22
23
24
25
# File 'lib/mongo_odm/document/attribute_methods/localization.rb', line 20

def localized_attribute?(attr_name)
  field = fields[attr_name]
  localized = field ? !!field.options[:localized] : false
  raise MongoODM::Errors::InvalidLocalizedField.new(field.name, field.type) if localized && field && field.type != Hash
  localized
end