You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.1
ruby version: 2.7.6
rails_admin version: 3.1.2
rails_admin npm package version: NA (Using sprockets)
A lack of tests for these code paths led to a regression for legacy enums in Rails Admin 3.0 (railsadminteam#3651).
This tests the code path using `abstract_model` that was fixed by @fuegas in the previous commit.
OK I could figure it out. The implementation in be9a75e has the issue of calling #filter_options without setting bindings, resulting in the nil error.
I've made a fix as d62f604, 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)The text was updated successfully, but these errors were encountered: