Skip to content

Commit

Permalink
Revert "FIX: fallback to custom type for flags (discourse#27961)" (di…
Browse files Browse the repository at this point in the history
…scourse#27962)

This reverts commit 7b6b7ca.
  • Loading branch information
lis2 authored Jul 18, 2024
1 parent 7b6b7ca commit bb54270
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions app/models/flag.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# frozen_string_literal: true

class Flag < ActiveRecord::Base
# TODO(2025-01-15): krisk remove
self.ignored_columns = ["custom_type"]

DEFAULT_VALID_APPLIES_TO = %w[Post Topic]
MAX_SYSTEM_FLAG_ID = 1000
MAX_NAME_LENGTH = 200
Expand All @@ -23,15 +26,6 @@ def self.valid_applies_to_types
Set.new(DEFAULT_VALID_APPLIES_TO | DiscoursePluginRegistry.flag_applies_to_types)
end

# TODO(2025-01-15): krisk remove
def require_message
if ActiveRecord::Base.connection.column_exists?(:flags, :require_message)
super
else
self.custom_type
end
end

def self.reset_flag_settings!
# Flags are memoized for better performance. After the update, we need to reload them in all processes.
PostActionType.reload_types
Expand Down

0 comments on commit bb54270

Please sign in to comment.