Module: Tagtical::Taggable::TagGroup

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

Instance Method Summary collapse

Instance Method Details

#has_many_through_tags(association_id, type = :subset, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/tagtical/taggable/tag_group.rb', line 5

def has_many_through_tags(association_id, type = :subset, options = {})
  case type
  when :subset then has_many_through_tags_subset(association_id, options)
  when :superset then has_many_through_tags_superset(association_id, options)
  else raise "Wrong association type, should be :subset or :superset"
  end
  after_save { instance_variable_set("@#{association_id}", nil) }
end