Module: ActiveRecord::Acts::Taggable::ClassMethods

Defined in:
lib/acts_as_taggable.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_taggableObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/acts_as_taggable.rb', line 9

def acts_as_taggable
  has_many :taggings, :as => :taggable, :dependent => :destroy, :include => :tag
  has_many :tags, :through => :taggings
  
  before_save :save_cached_tag_list
  
  after_create :save_tags
  after_update :save_tags
  
  include ActiveRecord::Acts::Taggable::InstanceMethods
  extend ActiveRecord::Acts::Taggable::SingletonMethods
  
  alias_method_chain :reload, :tag_list
end

#cached_tag_list_column_nameObject



24
25
26
# File 'lib/acts_as_taggable.rb', line 24

def cached_tag_list_column_name
  "cached_tag_list"
end

#set_cached_tag_list_column_name(value = nil, &block) ⇒ Object



28
29
30
# File 'lib/acts_as_taggable.rb', line 28

def set_cached_tag_list_column_name(value = nil, &block)
  define_attr_method :cached_tag_list_column_name, value, &block
end