This should be relatively trivial, but I'm having trouble working this out.
I have two models with a one_to_one relationship, one is "property" and the
other "owner". How would I get the following out of Sequel?
[
{property_id: 1, baz: "blah", owner: {name: "John", postal_address: "5
Archer St, Downtown VG 3533"}},
{property_id: 2, baz: "bleh", owner: {name: "Steven", postal_address: "32
Buchanan Rd, Uptown FA 1123"}},
...
]
I typically use #naked to get an array of hashes, but can't seem to work
out how to get that :owner sub-hash. Doing an #association_join(:owner) gets
the owner details, but flattens it out into a single merged property/owner
hash. I don't get a nice :owner sub-hash out of it.
Can someone point me in the right direction here?
Cheers
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.