mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 17:04:59 +08:00
FEATURE: New 'Reviewable' model to make reviewable items generic
Includes support for flags, reviewable users and queued posts, with REST API backwards compatibility. Co-Authored-By: romanrizzi <romanalejandro@gmail.com> Co-Authored-By: jjaffeux <j.jaffeux@gmail.com>
This commit is contained in:
@ -619,7 +619,7 @@ module Discourse
|
||||
end
|
||||
end
|
||||
|
||||
def self.deprecate(warning, drop_from: nil, since: nil, raise_error: false)
|
||||
def self.deprecate(warning, drop_from: nil, since: nil, raise_error: false, output_in_test: false)
|
||||
location = caller_locations[1].yield_self { |l| "#{l.path}:#{l.lineno}:in \`#{l.label}\`" }
|
||||
warning = ["Deprecation notice:", warning]
|
||||
warning << "(deprecated since Discourse #{since})" if since
|
||||
@ -635,6 +635,10 @@ module Discourse
|
||||
STDERR.puts(warning)
|
||||
end
|
||||
|
||||
if output_in_test && Rails.env == "test"
|
||||
STDERR.puts(warning)
|
||||
end
|
||||
|
||||
digest = Digest::MD5.hexdigest(warning)
|
||||
redis_key = "deprecate-notice-#{digest}"
|
||||
|
||||
|
Reference in New Issue
Block a user