mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
11 lines
276 B
Ruby
11 lines
276 B
Ruby
|
|
# frozen_string_literal: true
|
||
|
|
|
||
|
|
class Tagging < ApplicationRecord
|
||
|
|
belongs_to :taggable, polymorphic: true
|
||
|
|
belongs_to :tag
|
||
|
|
|
||
|
|
validates :taggable, presence: true
|
||
|
|
validates :tag, presence: true
|
||
|
|
validates :tag_id, uniqueness: { scope: [:taggable_type, :taggable_id] }
|
||
|
|
end
|