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