Module: Taggable::Page

Defined in:
lib/taggable/page.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

here we have a few special cases for page tags. because of the page tree



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/taggable/page.rb', line 7

def self.included(base)
  base.class_eval {
    has_tags
    has_one :pointer, :class_name => 'Tag'
    named_scope :children_of, lambda { |these|
      { :conditions => ["parent_id IN (#{these.map{'?'}.join(',')})", *these.map{|t| t.id}] }
    }
    extend Taggable::Page::ClassMethods
    include Taggable::Page::InstanceMethods
  }
end