-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow the specification of resource class names for associative fields #1821
Comments
Thank you for reporting this issue. In theory, the correct class should be detected through reflection at administrate/lib/administrate/field/associative.rb Lines 14 to 16 in 8408423
Would you be able to have a look there and see what's going on? |
Yeah let me do a little more digging and follow up. Thanks! |
I'm seeing this too, on a I believe the issue has to do something with class load order – since we're declaring those attributes as statics on the dashboard class, they're getting loaded before the AR models are completed initialized. I'll try to make some time to dig into this deeper. |
I think this should be fixed by #2292 |
pubs: Field::HasMany
without specifyingclass_name: Bar
in theFooDashboard
, Administrate will look for aPubDashboard
instead of theBarDashboard
. As per Automatic associations #1633class_name
is now deprecated, but all of the field should accept theresource_class
option. However, it currently isn't being used to determine the class name for (at least) theHasMany
field type.resource_class
option in the associative fields to determine the resource class if the association has a different name.Thanks!
The text was updated successfully, but these errors were encountered: