-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't delete :if and :unless from filters #2523
Conversation
What version of AA are you using? |
Scratch that; I can reproduce locally |
I think this would be a better solution: diff --git a/lib/active_admin/filters/resource_extension.rb b/lib/active_admin/filters/resource_extension.rb
index d348083..c0eac93 100644
--- a/lib/active_admin/filters/resource_extension.rb
+++ b/lib/active_admin/filters/resource_extension.rb
@@ -76,7 +76,7 @@ module ActiveAdmin
# Collapses the waveform, if you will, of which filters should be displayed.
# Removes filters and adds in default filters as desired.
def filter_lookup
- filters = @filters.try(:dup) || {}
+ filters = @filters.try(:deep_dup) || {} Since the whole point of using |
Yes, that looks like a better solution then. |
Could you add a test to confirm the bug is fixed? |
Sure. I will look into that. |
Coverage remained the same when pulling 809630a496fa292768ee9ccbc77d5a971be69be5 on PChambino:patch-1 into 82ff48d on gregbell:master. |
Looks good, thanks. One more thing: can you squash this into a single commit with a good commit message? |
Filter :if and :unless options were being deleted and thus only used for the first request. Deep copy of the filters hash allow safe deletion of filters' options like :if and :unless, to pass a clean set of options down the line.
Is something like this ok? |
Perfect. Thanks for the contribution! |
Don't delete :if and :unless from filters
Filter :if and :unless options were being deleted and thus only used for the first request.