mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 02:04:33 +08:00
12 lines
424 B
Ruby
12 lines
424 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class ShareableLink < ApplicationRecord
|
||
|
validates :shareable_type, uniqueness: { scope: :shareable_id }
|
||
|
validates :description, length: { maximum: Constants::RICH_TEXT_MAX_LENGTH }
|
||
|
|
||
|
belongs_to :shareable, polymorphic: true, inverse_of: :shareable_link
|
||
|
belongs_to :team
|
||
|
belongs_to :created_by, class_name: 'User'
|
||
|
belongs_to :last_modified_by, class_name: 'User', optional: true
|
||
|
end
|