Make sure @resource is also set for nested fields #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @nickcharlton - long time since we've interacted on Administrate-related things!
I love this gem and it's been really useful in my latest project. One bug I found is that if any of the fields from the associated dashboard use
self.resource
, they end up picking up the parent resource instead of the nested one.You'd already used
instance_variable_set
to set theself.data
and so I propose that the gem uses the same methodology to setresource
.I've tested this fix in my app that has a full test suite and it hasn't broken any of the tests in that app. I couldn't get the gem's tests to run because they depend on a postgres database, which I don't have, but I couldn't see a place in the tests for defending this change anyway - the earlier
@data
setting doesn't appear to have a test defending it.Let me know what you think!