module ActiveRecord::Acts::Keywordable::ClassMethods

Public Instance Methods

acts_as_keywordable(options = {}) click to toggle source
# File lib/acts_as_keywordable.rb, line 13
def acts_as_keywordable(options = {})
  class_attribute(:acts_as_keywordable_options, {
    :keywordable_type => self.base_class.name.to_s,
    :from => options[:from]
  })


  has_many :keywordings, :as => :keywordable, :dependent => :destroy
  has_many :keywords, :through => :keywordings

  include ActiveRecord::Acts::Keywordable::InstanceMethods
  extend ActiveRecord::Acts::Keywordable::SingletonMethods
end