-
Notifications
You must be signed in to change notification settings - Fork 2.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
Filters broken with mongoid field alias #1766
Comments
And here's a stack trace: /home/sebastian/Code/rails_admin/app/views/rails_admin/main/index.html.haml:39:in |
Dup of #1745. |
I am using rails_admin with mongoid. When using mongoid's
:as
options, filters in rails_admin stop working.For example, the following works as expected:
While this does not:
The name of the field has changed from
:long_name
to:l
,:long_name
is now stored infield.options[:as]
. Mongoid maps between both names transparently, rails_admin does not. A workaround exists:For better readability and consistency with mongoid's behavior, rails_admin should map between field names and aliases. It should be possible to use either the field name or the alias everywhere.
I would like to provide a pull request, if you can point me in the right direction. Is there a central place in rails_admin's mongoid adapter where field name resolution is taking place? Where should I start looking, or how would you go about improving this?
The text was updated successfully, but these errors were encountered: