scinote-web/app/models/view_state.rb
2018-10-10 16:15:31 +02:00

11 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