module Hoodoo::ActiveRecord::Translated

Support mixin for models subclassed from ActiveRecord::Base providing as-per-API-standard internationalisation support. See Hoodoo::ActiveRecord::Translated::ClassMethods#translated for details.

See also:

Public Class Methods

included( model ) click to toggle source

Instantiates this module when it is included.

Example:

class SomeModel < ActiveRecord::Base
  include Hoodoo::ActiveRecord::Translated
  # ...
end
model

The ActiveRecord::Base descendant that is including this module.

Calls superclass method
# File lib/hoodoo/active/active_record/translated.rb, line 36
def self.included( model )
  model.class_attribute(
    :nz_co_loyalty_hoodoo_translate_with,
    :instance_predicate => false,
    :instance_accessor  => false
  )

  instantiate( model ) unless model == Hoodoo::ActiveRecord::Base
  super( model )
end
instantiate( model ) click to toggle source

When instantiated in an ActiveRecord::Base subclass, all of the Hoodoo::ActiveRecord::Translated::ClassMethods methods are defined as class methods on the including class.

model

The ActiveRecord::Base descendant that is including this module.

# File lib/hoodoo/active/active_record/translated.rb, line 54
def self.instantiate( model )
  model.extend( ClassMethods )
end