Module: Gluttonberg::Content::Localization
- Defined in:
- lib/gluttonberg/content/localization.rb
Overview
A mixin which allows for any arbitrary model to be localized. It will generate the localization models and add methods for creating and retrieving localized versions of a record.
Defined Under Namespace
Modules: Model, ModelLocalization
Class Method Summary collapse
-
.included(klass) ⇒ Object
The included hook is used to create a bunch of class ivars we need to store various bits of configuration.
Class Method Details
.included(klass) ⇒ Object
The included hook is used to create a bunch of class ivars we need to store various bits of configuration.
9 10 11 12 13 14 15 16 17 |
# File 'lib/gluttonberg/content/localization.rb', line 9 def self.included(klass) klass.class_eval do extend Model::ClassMethods include Model::InstanceMethods cattr_accessor :localized, :localized_model, :localized_model_name, :localized_fields, :locale; self.localized = false self.localized_fields = [] end end |