mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
11 lines
424 B
Ruby
11 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
|