Update `enum` away from deprecated (#29678)
parent
01464074c9
commit
cdd168f5d3
|
@ -16,7 +16,7 @@ class RelationshipSeveranceEvent < ApplicationRecord
|
||||||
|
|
||||||
has_many :severed_relationships, inverse_of: :relationship_severance_event, dependent: :delete_all
|
has_many :severed_relationships, inverse_of: :relationship_severance_event, dependent: :delete_all
|
||||||
|
|
||||||
enum type: {
|
enum :type, {
|
||||||
domain_block: 0,
|
domain_block: 0,
|
||||||
user_domain_block: 1,
|
user_domain_block: 1,
|
||||||
account_suspension: 2,
|
account_suspension: 2,
|
||||||
|
|
|
@ -20,7 +20,7 @@ class SeveredRelationship < ApplicationRecord
|
||||||
belongs_to :local_account, class_name: 'Account'
|
belongs_to :local_account, class_name: 'Account'
|
||||||
belongs_to :remote_account, class_name: 'Account'
|
belongs_to :remote_account, class_name: 'Account'
|
||||||
|
|
||||||
enum direction: {
|
enum :direction, {
|
||||||
passive: 0, # analogous to `local_account.passive_relationships`
|
passive: 0, # analogous to `local_account.passive_relationships`
|
||||||
active: 1, # analogous to `local_account.active_relationships`
|
active: 1, # analogous to `local_account.active_relationships`
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ module Mastodon::CLI
|
||||||
class SeveredRelationship < ApplicationRecord; end
|
class SeveredRelationship < ApplicationRecord; end
|
||||||
|
|
||||||
class DomainBlock < ApplicationRecord
|
class DomainBlock < ApplicationRecord
|
||||||
enum severity: { silence: 0, suspend: 1, noop: 2 }
|
enum :severity, { silence: 0, suspend: 1, noop: 2 }
|
||||||
scope :by_severity, -> { in_order_of(:severity, %w(noop silence suspend)).order(:domain) }
|
scope :by_severity, -> { in_order_of(:severity, %w(noop silence suspend)).order(:domain) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue