Module: RocketTag::Taggable

Included in:
ActiveRecord::Base
Defined in:
lib/rocket_tag/taggable.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Manager

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
# File 'lib/rocket_tag/taggable.rb', line 5

def self.included(base)
  base.extend ClassMethods
  base.send :include, InstanceMethods
end

Instance Method Details

#destroy_tags_for_context(context) ⇒ Object



50
51
52
# File 'lib/rocket_tag/taggable.rb', line 50

def destroy_tags_for_context context
  taggings_for_context(context).delete_all
end

#taggings_for_context(context) ⇒ Object



46
47
48
# File 'lib/rocket_tag/taggable.rb', line 46

def taggings_for_context context
  taggings.where{taggings.context==my{context}}
end