marker.rb 626 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: markers
  5. #
  6. # id :bigint(8) not null, primary key
  7. # user_id :bigint(8)
  8. # timeline :string default(""), not null
  9. # last_read_id :bigint(8) default(0), not null
  10. # lock_version :integer default(0), not null
  11. # created_at :datetime not null
  12. # updated_at :datetime not null
  13. #
  14. class Marker < ApplicationRecord
  15. TIMELINES = %w(home notifications).freeze
  16. belongs_to :user
  17. validates :timeline, :last_read_id, presence: true
  18. validates :timeline, inclusion: { in: TIMELINES }
  19. end