Closed deepakisrani closed 1 month ago
The fix in #3647 solved my issue.
OK I could figure it out. The implementation in be9a75e504edd9a754157a4ddba590e8a5d14149 has the issue of calling #filter_options
without setting bindings, resulting in the nil error.
I've made a fix as d62f604cc8d7d1434f7dfe0c5aca3aaf3dc2547b, so please give it a try.
Description When applying the filters on the fields populated using the legacy enum, rails_admin breaks throwing the
undefined method [] for nil:NilClass
while rendering the content on the page.We use rails_admin in a large Rails project and started facing this issue after upgrading rails_admin from 2 to 3 and the Rails version from 6 to 7. I have created a dummy application replicating the setup we have with all the configuration, first we had assumed that the problem lies within the configuration of our company's code but the issue replicated itself within the new application as well, link to the repo, this was a fresh install of Rails 7.1 along with rails_admin.
Reproduction Steps Apply a filter on any of the fields utilizing the legacy enum.
Expected Behavior Expect the page to render properly with either the resulting set or no records found.
Additional context
rails
version: 7.1ruby
version: 2.7.6rails_admin
version: 3.1.2rails_admin
npm package version: NA (Using sprockets)