Class: ReviewsIoVideo

Inherits:
ApplicationRecord show all
Defined in:
app/models/reviews_io_video.rb

Overview

Join model linking ReviewsIo records to imported Video records.
Tracks which external video URL was imported, enabling idempotent re-imports.
== Schema Information

Table name: reviews_io_videos
Database name: primary

id :bigint not null, primary key
source_url :string not null
created_at :datetime not null
updated_at :datetime not null
reviews_io_id :bigint not null
video_id :bigint not null

Indexes

index_reviews_io_videos_on_reviews_io_id_and_video_id (reviews_io_id,video_id) UNIQUE
index_reviews_io_videos_on_source_url (source_url)
index_reviews_io_videos_on_video_id (video_id)

Foreign Keys

fk_rails_... (reviews_io_id => reviews_io.id)
fk_rails_... (video_id => digital_assets.id)

Instance Attribute Summary collapse

Belongs to collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Instance Attribute Details

#source_urlObject (readonly)



32
# File 'app/models/reviews_io_video.rb', line 32

validates :source_url, presence: true

#video_idObject (readonly)



33
# File 'app/models/reviews_io_video.rb', line 33

validates :video_id, uniqueness: { scope: :reviews_io_id }

Instance Method Details

#reviews_ioReviewsIo

Returns:

See Also:



29
# File 'app/models/reviews_io_video.rb', line 29

belongs_to :reviews_io

#videoVideo

Returns:

See Also:



30
# File 'app/models/reviews_io_video.rb', line 30

belongs_to :video