mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 14:46:00 +08:00
12 lines
239 B
Ruby
12 lines
239 B
Ruby
|
# frozen_string_literal:true
|
||
|
|
||
|
class ViewState < ApplicationRecord
|
||
|
belongs_to :user
|
||
|
belongs_to :viewable, polymorphic: true
|
||
|
|
||
|
validates :viewable_id, uniqueness: {
|
||
|
scope: %i(viewable_type user_id),
|
||
|
message: :not_unique
|
||
|
}
|
||
|
end
|