rom-rb / rom-http

Abstract HTTP adapter for ROM
https://rom-rb.org
MIT License
73 stars 18 forks source link

Add documentation for how to convert to a domain object #11

Closed joevandyk closed 5 years ago

joevandyk commented 8 years ago

In the example in the README right now, calling container.relation(:users).by_id(1) returns a hash. It would be nice to see how to get some sort of domain object back.

hmadison commented 8 years ago

See Mapping to custom objects.

cflipse commented 8 years ago

I will note that documentation improvement is definatly needed. This gem is still in an early, rough state.

joevandyk commented 8 years ago

I saw that section, but I'm still confused.

solnic commented 8 years ago

Which part is confusing? Assuming you've got a repo configured to use :users relation, you simply do users.by_id(1).as(YourUserClass).

joevandyk commented 8 years ago

Ah, perfect. Thanks.

Not sure if I'm blind, but can't see where as is mentioned in that page.

solnic commented 8 years ago

It is mentioned :) Anyhow, a more comprehensive guide will be written as soon as I'm done with new rom-sql and rom-repository versions.

solnic commented 5 years ago

Closing as this is outdated. User docs are still pending, even after 3 years. Oh well. There's an issue about it in rom-rb/rom-rb.org#279