From 02d704d2de3a045f3900c8ef503cd5fbce34b809 Mon Sep 17 00:00:00 2001 From: Anton Katunin Date: Tue, 9 Jul 2024 11:38:03 +1000 Subject: [PATCH] Fix nested filters --- lib/active_interaction/extras/model_fields.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/active_interaction/extras/model_fields.rb b/lib/active_interaction/extras/model_fields.rb index 0f97cd0..1855ba3 100644 --- a/lib/active_interaction/extras/model_fields.rb +++ b/lib/active_interaction/extras/model_fields.rb @@ -29,11 +29,11 @@ class Context < SimpleDelegator attr_accessor :from_model_name attr_accessor :model_field_cache - def custom_filter_attribute(name, opts = {}) + def custom_filter_attribute(name, opts = {}, &block) from_model_name = self.from_model_name model_field_cache[from_model_name] = model_field_cache[from_model_name] << name - __getobj__.send __callee__, name, opts + __getobj__.send __callee__, name, opts, &block end alias interface custom_filter_attribute