adapt deprecation warning

This commit is contained in:
ulferts
2025-03-01 21:02:09 +01:00
parent 0194981f16
commit 6eac5926eb
8 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -388,7 +388,7 @@ module ApplicationHelper
end
def calendar_for(*_args)
ActiveSupport::Deprecation.warn(
ActiveSupport::Deprecation.new.warn(
"calendar_for has been removed. Please use the opce-basic-single-date-picker angular component instead",
caller
)
+1 -1
View File
@@ -93,7 +93,7 @@ class Setting < ApplicationRecord
definition = Settings::Definition[:#{name}]
if definition.format != :boolean
ActiveSupport::Deprecation.warn "Calling #{self}.#{name}? is deprecated since it is not a boolean", caller
ActiveSupport::Deprecation.new.warn "Calling #{self}.#{name}? is deprecated since it is not a boolean", caller
end
value = self[:#{name}]
+1 -1
View File
@@ -107,7 +107,7 @@ module OpenProject
# including user info and credentials.
# @yieldparam context The context from which the callback is called, e.g. a Controller.
def self.after_login(&)
ActiveSupport::Deprecation.warn(
ActiveSupport::Deprecation.new.warn(
"after_login does not return the actually logged in user and has been deprecated. " \
"Please use OpenProject::Hook omniauth_user_authorized or user_logged_in hooks instead",
caller
+1 -1
View File
@@ -376,7 +376,7 @@ module Redmine # :nodoc:
#
# Note that :view_scrums permission is required to view these events in the activity view.
def activity_provider(*)
ActiveSupport::Deprecation.warn("Use ActsAsOpEngine#activity_provider instead.")
ActiveSupport::Deprecation.new.warn("Use ActsAsOpEngine#activity_provider instead.")
OpenProject::Activity.register(*)
end
+2 -1
View File
@@ -133,7 +133,8 @@ module OpenProject
define_singleton_method :"#{definition.name}?" do
if definition.format != :boolean
ActiveSupport::Deprecation.warn "Calling #{self}.#{definition.name}? is deprecated since it is not a boolean", caller
ActiveSupport::Deprecation.new.warn "Calling #{self}.#{definition.name}? is deprecated since it is not a boolean",
caller
end
TRUE_VALUES.include? self[definition.name]
end
+1 -1
View File
@@ -160,7 +160,7 @@ module OpenProject
def self.mysql?(_arg = nil)
message = ".mysql? is no longer supported and will always return false. Remove the call."
ActiveSupport::Deprecation.warn message, caller
ActiveSupport::Deprecation.new.warn message, caller
false
end
+2 -2
View File
@@ -64,12 +64,12 @@ module Entry
private
def all(*args)
ActiveSupport::Deprecation.warn("Passing arguments is deprecated") if args.any?
ActiveSupport::Deprecation.new.warn("Passing arguments is deprecated") if args.any?
find_many :all # *args
end
def count(*args)
ActiveSupport::Deprecation.warn("Passing arguments is deprecated") if args.any?
ActiveSupport::Deprecation.new.warn("Passing arguments is deprecated") if args.any?
find_many :count # *args
end
@@ -120,7 +120,7 @@ module Storages
end
def automatically_managed?
ActiveSupport::Deprecation.warn(
ActiveSupport::Deprecation.new.warn(
"`#automatically_managed?` is deprecated. Use `#automatic_management_enabled?` instead. " \
"NOTE: The new method name better reflects the actual behavior of the storage. " \
"It's not the storage that is automatically managed, rather the Project (Storage) Folder is. " \