Module: Tagtical::Taggable::Ownership::ClassMethods

Defined in:
lib/tagtical/taggable/ownership.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_taggable(*args) ⇒ Object



13
14
15
16
# File 'lib/tagtical/taggable/ownership.rb', line 13

def acts_as_taggable(*args)
  initialize_acts_as_taggable_ownership
  super(*args)
end

#initialize_acts_as_taggable_ownershipObject



18
19
20
21
22
23
24
25
26
# File 'lib/tagtical/taggable/ownership.rb', line 18

def initialize_acts_as_taggable_ownership
  tag_types.each do |tag_type|
    class_eval <<-RUBY, __FILE__, __LINE__ + 1
      def #{tag_type.pluralize}_from(owner)
        owner_tag_list_on(owner, '#{tag_type}')
      end      
    RUBY
  end
end