mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-10 05:46:47 +08:00
9 lines
268 B
Ruby
9 lines
268 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Tagging < ApplicationRecord
|
|
belongs_to :tag
|
|
belongs_to :taggable, polymorphic: true, inverse_of: :taggings
|
|
belongs_to :created_by, class_name: 'User', optional: true
|
|
|
|
validates :tag_id, uniqueness: { scope: :taggable }
|
|
end
|