Closed arianics closed 8 months ago
This is good :) There is another issue here though which is that it is hard-coded record.id
, which means it will blow up for any records without an id! Not great. I'll merge this, as this looks like a good fix to the issue you found, but we'll need to encode the actual primary key of the record to avoid the issue.
🚀 Thank you for your contribution! 🚀
I would also assume that the same fix needs to be applied for attribute with type of Ash.Type.Map
.
Yep, and that line you linked to there actually has the fix for the record.id
: AshAdmin.Helpers.encode_primary_key(@record)
. @vonagam I'm busy for the next few hours/this evening, do you have a few to make that PR? Thank you as always for your attention to detail!
Oh, busy myself and don't have much experience with AshAdmin yet (don't have it setup for contributing)... But my 5c for future: this and this need updating. Those will be relevant for relationships of cardinality one (for cardinality many this PR should have fixed it, but yeah, need to use different thing for id).
No problem, I'll take care of it! Thanks for pointing it out :)
…e that has sensitive fields
Duplicate ID error is raised when a resource with sensitive attributes is present more than once on admin pages.
** (RuntimeError) found duplicate ID "a9f8b9fe-c1be-471e-b7c6-973cc1152e15-history" for component AshAdmin.Components.Resource.SensitiveAttribute when rendering template
please let me know if there's better way of doing this.
Contributor checklist