Sha256: 2182b6be042c94cbff073d61c97dee2092e0b3b06e193fda4aaa80b86de0195a

Contents?: true

Size: 544 Bytes

Versions: 26

Compression:

Stored size: 544 Bytes

Contents

module Effective
  class Tagging < ApplicationRecord
    self.table_name = (EffectivePages.taggings_table_name || :taggings).to_s

    belongs_to :tag, class_name: 'Effective::Tag'
    belongs_to :taggable, polymorphic: true

    scope :deep, -> { all }

    effective_resource do
      tag_id          :integer
      taggable_id     :integer
      taggable_type   :string

      timestamps
    end

    validates :tag_id, uniqueness: { scope: [:taggable_type, :taggable_id] }

    public

    def to_s
      model_name.human
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
effective_pages-3.14.1 app/models/effective/tagging.rb
effective_pages-3.14.0 app/models/effective/tagging.rb
effective_pages-3.13.5 app/models/effective/tagging.rb
effective_pages-3.13.4 app/models/effective/tagging.rb
effective_pages-3.13.3 app/models/effective/tagging.rb
effective_pages-3.13.2 app/models/effective/tagging.rb
effective_pages-3.13.1 app/models/effective/tagging.rb
effective_pages-3.13.0 app/models/effective/tagging.rb
effective_pages-3.12.0 app/models/effective/tagging.rb
effective_pages-3.11.0 app/models/effective/tagging.rb
effective_pages-3.10.3 app/models/effective/tagging.rb
effective_pages-3.10.2 app/models/effective/tagging.rb
effective_pages-3.10.1 app/models/effective/tagging.rb
effective_pages-3.10.0 app/models/effective/tagging.rb
effective_pages-3.9.0 app/models/effective/tagging.rb
effective_pages-3.8.4 app/models/effective/tagging.rb
effective_pages-3.8.3 app/models/effective/tagging.rb
effective_pages-3.8.2 app/models/effective/tagging.rb
effective_pages-3.8.1 app/models/effective/tagging.rb
effective_pages-3.8.0 app/models/effective/tagging.rb