11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/cms/behaviors/taggable.rb', line 11
def is_taggable(options={})
@is_taggable = true
@tag_separator = options[:separator] || " "
has_many :taggings, :as => :taggable, :class_name => 'Cms::Tagging'
has_many :tags, :through => :taggings, :order => "#{Cms::Tag.table_name}.name", :class_name => 'Cms::Tag'
scope :tagged_with, lambda{|t| {:include => {:taggings => :tag}, :conditions => ["#{Cms::Tag.table_name}.name = ?", t]} }
after_save :save_tags
extend ClassMethods
include InstanceMethods
attr_accessible :tag_list
end
|