From ec686a8d1adfeb7c63bba05dc46c2ea8d53164eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 19 Mar 2024 22:32:20 +0100 Subject: [PATCH] Ignore touch audited callbacks globally This is possible since audited 5.4.3, and IMHO it's useful because audited has added a callback on touch, which could result in strange behavior since we might use the `touch` method to expire the cache without doing any changes. While this doesn't affect our application because we're using the `on:` option of the `audited` method in the budget investment model, it'll make it easier to enable audited for other classes in custom installations without having to worry about the (usually undesired) touch callbacks. --- config/initializers/audited.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/initializers/audited.rb b/config/initializers/audited.rb index 74ad9b5a3..14de509e8 100644 --- a/config/initializers/audited.rb +++ b/config/initializers/audited.rb @@ -1,3 +1,4 @@ Audited.config do |config| config.audit_class = ::Audit + config.ignored_default_callbacks = [:touch] end