A solution I'm using, that suits my needs anyway, is to create a
relationship after the instance is created. I do the following:

model = Model.get(1)
model.extend_model

extend_model creates the relationship with a belongs_to call based on
information from the instance rather than the class. From there I can
get all the attributes of the associated model through:
model.extended.<attribute or method>

It'd be really nice to be able to do this automatically and not have
to call extend_model explicitly, but I still haven't figured out how
to get the model to create the relationship right after talking to the
data source. None of the hooks, so far as I can, work there.

On Jan 12, 6:16 am, "Dirkjan Bussink" <[email protected]> wrote:
> On Mon, Jan 12, 2009 at 2:56 PM, Justin Reagor <[email protected]> wrote:
> > This has been covered many times on the mailing list, and other areas. But a
> > concrete, DataMapper sanctioned practice has never been appropriately
> > determined. Can someone start a wiki page so we have some direction on this
> > topic?
>
> There is dm-is-remixable, doesn't that work as an alternative? Afaik
> that has most often been suggested, but I don't know how well it
> works.
>
> --
> Regards,
>
> Dirkjan Bussink
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to