闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
626 B

  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