Add database row to hold status content type

This commit is contained in:
Thibaut Girka
2019-05-12 20:14:35 +02:00
committed by ThibG
parent c1cf8c1636
commit bfc509f44a
3 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,7 @@
# local_only :boolean
# full_status_text :text default(""), not null
# poll_id :bigint(8)
# content_type :string
#
class Status < ApplicationRecord
@ -74,6 +75,7 @@ class Status < ApplicationRecord
validates_with DisallowedHashtagsValidator
validates :reblog, uniqueness: { scope: :account }, if: :reblog?
validates :visibility, exclusion: { in: %w(direct limited) }, if: :reblog?
validates :content_type, inclusion: { in: %w(text/plain text/markdown) }, allow_nil: true
accepts_nested_attributes_for :poll