Sha256: 2f3631af631ee5260407233606ef04573d56f9d2a8b6d6ab3ec04b30fe1cec10

Contents?: true

Size: 353 Bytes

Versions: 1

Compression:

Stored size: 353 Bytes

Contents

module MyTags::ActiveRecord
  def self.included(base)
    base.extend MyTags::ActiveRecord::ClassMethods
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
my_tags-0.0.2 lib/my_tags/active_record.rb