DEV: Remove version-number-based logic (#25482)

The `deprecate_column` helper would change its behavior based on the current `Discourse::VERSION`. This means that 'finalizing' a stable release introduces a previously untested behavior change.

Much better to keep it as a deprecation until manual action is taken to introduce the breaking change.
This commit is contained in:
David Taylor 2024-01-30 17:34:10 +00:00 committed by GitHub
parent 9b50de4569
commit 88305e3d96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 12 deletions

View File

@ -5,10 +5,7 @@ module HasDeprecatedColumns
class_methods do
def deprecate_column(column_name, drop_from:, raise_error: false, message: nil)
if Gem::Version.new(Discourse::VERSION::STRING) >= Gem::Version.new(drop_from)
self.ignored_columns = self.ignored_columns.dup << column_name.to_s
else
message = message.presence || "column `#{column_name}` is deprecated"
message = message.presence || "column `#{column_name}` is deprecated."
define_method(column_name) do
Discourse.deprecate(message, drop_from: drop_from, raise_error: raise_error)
@ -22,4 +19,3 @@ module HasDeprecatedColumns
end
end
end
end