mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
adapt deprecation warning
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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}]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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. " \
|
||||
|
||||
Reference in New Issue
Block a user