mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-05 04:55:05 +00: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
24 lines
790 B
Ruby
24 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
|