mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
DEV: Improve add_to_serializer include_* options (#21220)
- Move the old '`define_include_method`' arg to a `respect_plugin_enabled` kwarg - Introduce an `include_condition` kwarg which can be passed a lambda with inclusion logic. Lambda will be run via `instance_exec` in the context of the serializer instance This is backwards compatible - old-style invocations will trigger a deprecation message
This commit is contained in:
@ -975,7 +975,8 @@ module Discourse
|
||||
digest = Digest::MD5.hexdigest(warning)
|
||||
redis_key = "deprecate-notice-#{digest}"
|
||||
|
||||
if Rails.logger && !Discourse.redis.without_namespace.get(redis_key)
|
||||
if Rails.logger && !GlobalSetting.skip_redis? &&
|
||||
!Discourse.redis.without_namespace.get(redis_key)
|
||||
Rails.logger.warn(warning)
|
||||
begin
|
||||
Discourse.redis.without_namespace.setex(redis_key, 3600, "x")
|
||||
|
Reference in New Issue
Block a user