Sha256: 99a809e9b897d44cf2accba0aedb1da670e763e25766af4b3b27ee2d13f9a621

Contents?: true

Size: 407 Bytes

Versions: 14

Compression:

Stored size: 407 Bytes

Contents

module Tagalong
  class TagalongTag < ::ActiveRecord::Base
    has_many :tagalong_taggings, :dependent => :destroy, :class_name => 'Tagalong::TagalongTagging'
    belongs_to :tagger, :polymorphic => true

    validates_presence_of :name
    validates_uniqueness_of :name, :scope => [ :tagger_id, :tagger_type ]

    def taggables
      tagalong_taggings.map { |tagging| tagging.taggable }
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
tagalong-0.1.4 lib/tagalong/tagalong_tag.rb
tagalong-0.1.3 lib/tagalong/tagalong_tag.rb
tagalong-0.1.2 lib/tagalong/tagalong_tag.rb
tagalong-0.1.1 lib/tagalong/tagalong_tag.rb
tagalong-0.1.0 lib/tagalong/tagalong_tag.rb
tagalong-0.0.9 lib/tagalong/tagalong_tag.rb
tagalong-0.0.8 lib/tagalong/tagalong_tag.rb
tagalong-0.0.7 lib/tagalong/tagalong_tag.rb
tagalong-0.0.6 lib/tagalong/tagalong_tag.rb
tagalong-0.0.5 lib/tagalong/tagalong_tag.rb
tagalong-0.0.4 lib/tagalong/tagalong_tag.rb
tagalong-0.0.3 lib/tagalong/tagalong_tag.rb
tagalong-0.0.2 lib/tagalong/tagalong_tag.rb
tagalong-0.0.1 lib/tagalong/tagalong_tag.rb