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.

28 lines
896 B

  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: status_edits
  5. #
  6. # id :bigint(8) not null, primary key
  7. # status_id :bigint(8) not null
  8. # account_id :bigint(8)
  9. # text :text default(""), not null
  10. # spoiler_text :text default(""), not null
  11. # media_attachments_changed :boolean default(FALSE), not null
  12. # created_at :datetime not null
  13. # updated_at :datetime not null
  14. #
  15. class StatusEdit < ApplicationRecord
  16. belongs_to :status
  17. belongs_to :account, optional: true
  18. default_scope { order(id: :asc) }
  19. delegate :local?, to: :status
  20. def emojis
  21. return @emojis if defined?(@emojis)
  22. @emojis = CustomEmoji.from_text([spoiler_text, text].join(' '), status.account.domain)
  23. end
  24. end