Module: TagSharkHorse::ActiveRecord::ClassMethods

Defined in:
lib/tag_sharkhorse/active_record.rb

Instance Method Summary collapse

Instance Method Details

#has_many_tagsObject

Set up the underlying tag associations in the model



9
10
11
12
13
14
# File 'lib/tag_sharkhorse/active_record.rb', line 9

def has_many_tags
  has_many :taggings, :class_name => 'TagSharkHorse::Tagging',
  :as => :taggable, :dependent => :destroy
  has_many :tags,     :class_name => 'TagSharkHorse::Tag',
  :through => :taggings
end