Module: ActiveRecord::Acts::ActsAsMtObject::ClassMethods

Defined in:
lib/acts_as_mt_object.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_mt_object(options = {}, &extension) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/acts_as_mt_object.rb', line 13

def acts_as_mt_object(options = {}, &extension)
  options = {
    :mt_class   => self.to_s
  }.merge(options)

  class_variable_set(
    '@@mt_class', options[:mt_class].to_s.sub(/.*::/, '').downcase
  )

  send :include, ActiveRecord::Acts::ActsAsMtObject::ActMethods
end