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
fix deleting if and unless options from filters #2832
Conversation
Are you sure your application was using the latest code on master? Because I'm almost positive that I've fixed this problem before. |
Or, @PChambino did: #2523 |
@seanlinsley , it is almost the same as #2523 , but fix #2523 can't be backported to 0.6.3 and can be used only with rails4 because Array#deep_dup was added in rails4, rails/rails@657b4ff |
|
@seanlinsley , if it's Hash then yes it's ok. https://github.com/gregbell/active_admin/blob/master/lib/active_admin/filters/resource_extension.rb#L20 this comment make me thing that it is still array in master. |
@seanlinsley, if you are going to backport both #2523 and ca92329 to 0.6.3 it is ok for me, so we can close this PR |
Turns out #2523 can't be backported for 0.6.3 since |
@seanlinsley , I tested it and I can tell that your commit doesn't help. |
@seanlinsley your commit (fa0edec) have next lines
I belive I mean
So first failed condition turns off all other filters |
Ah... thanks for catching that. (in which I add tests that try adding more than one filter at a time) |
Finally done. |
I have next code in one of my AA applications which use dynamic filter using if, unless options
It works , but only first time, after reloading page I all filters are on the sidebar like it was no :if . I started to debug and noticed that after first rendering, if and unless options are not used anymore, because they were deleted in active_admin_filters_form_for method.