2020-07-25 00:48:31 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: status_bookmarks
|
|
|
|
#
|
2020-12-16 00:31:30 +00:00
|
|
|
# id :bigint(8) not null, primary key
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
# account_id :bigint(8) not null
|
|
|
|
# status_id :bigint(8) not null
|
|
|
|
# status_bookmark_collection_id :bigint(8)
|
2020-07-25 00:48:31 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
class StatusBookmark < ApplicationRecord
|
|
|
|
include Paginable
|
|
|
|
|
|
|
|
belongs_to :account, inverse_of: :status_bookmarks
|
|
|
|
belongs_to :status, inverse_of: :status_bookmarks
|
|
|
|
|
|
|
|
validates :status_id, uniqueness: { scope: :account_id }
|
|
|
|
|
|
|
|
before_validation do
|
|
|
|
self.status = status.reblog if status&.reblog?
|
|
|
|
end
|
2020-08-06 04:51:49 +01:00
|
|
|
end
|