Field type that can use a resource that is not persisted #1668
segiddins
started this conversation in
Feature requests
Replies: 1 comment 3 replies
-
@segiddins can you share some code for this? A reference to a PR is fine if you have it (snippet will do too). |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think trying to summarize this in a title probably made it even more confusing 😅
I'm creating an active record subclass that uses
attribute
to serialize/deserialize a JSON field to another class, which happens to be anActiveModel
subclass.I've been poking around, and it seems doable to create a subclass of the
HasOneField
where the show component directly embeds the ResourceComponent for the attribute, but it doesn't look 100% natural, and I also haven't gotten around to testing updates yet. There was also some hackery needed to work around the assumption that every resource's model has anid
field.This is what I've got for now, but I was wondering if you have anything on the roadmap to make embedding these sort of resource fields (that don't map to persisted records) any easier?
Beta Was this translation helpful? Give feedback.
All reactions