conversation.rb 392 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: conversations
  5. #
  6. # id :bigint(8) not null, primary key
  7. # uri :string
  8. # created_at :datetime not null
  9. # updated_at :datetime not null
  10. #
  11. class Conversation < ApplicationRecord
  12. validates :uri, uniqueness: true, if: :uri?
  13. has_many :statuses
  14. def local?
  15. uri.nil?
  16. end
  17. end