Sha256: b968f186c326d4ea0efecd75664584a2fcc90434aa60e3c00e54cea91adc6926

Contents?: true

Size: 611 Bytes

Versions: 3

Compression:

Stored size: 611 Bytes

Contents

module Elabs
  class Tag < ApplicationRecord
    self.table_name = 'tags'

    validates :name, presence: true

    has_many :albums_tags
    has_many :articles_tags
    has_many :notes_tags
    has_many :projects_tags
    has_many :uploads_tags
    has_many :albums,   through: :albums_tags,     dependent: :destroy
    has_many :articles, through: :articles_tags,   dependent: :destroy
    has_many :notes,    through: :notes_tags,      dependent: :destroy
    has_many :projects, through: :projects_tags,   dependent: :destroy
    has_many :uploads,  through: :uploads_tags,    dependent: :destroy
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elabs-3.0.0 app/models/elabs/tag.rb
elabs-2.0.0 app/models/elabs/tag.rb
elabs-2.0.0.pre app/models/elabs/tag.rb