mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
10 lines
276 B
Ruby
10 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
|