mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 18:02:59 +01:00
3c033c4352
* Add moderation warnings Replace individual routes for disabling, silencing, and suspending a user, as well as the report update route, with a unified account action controller that allows you to select an action (none, disable, silence, suspend) as well as whether it should generate an e-mail notification with optional custom text. That notification, with the optional custom text, is saved as a warning. Additionally, there are warning presets you can configure to save time when performing the above. * Use Account#local_username_and_domain
23 lines
790 B
Ruby
23 lines
790 B
Ruby
# frozen_string_literal: true
|
|
# == Schema Information
|
|
#
|
|
# Table name: account_warnings
|
|
#
|
|
# id :bigint(8) not null, primary key
|
|
# account_id :bigint(8)
|
|
# target_account_id :bigint(8)
|
|
# action :integer default("none"), not null
|
|
# text :text default(""), not null
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|
|
|
|
class AccountWarning < ApplicationRecord
|
|
enum action: %i(none disable silence suspend), _suffix: :action
|
|
|
|
belongs_to :account, inverse_of: :account_warnings
|
|
belongs_to :target_account, class_name: 'Account', inverse_of: :targeted_account_warnings
|
|
|
|
scope :latest, -> { order(created_at: :desc) }
|
|
scope :custom, -> { where.not(text: '') }
|
|
end
|