On Tue, Jun 2, 2009 at 3:52 PM, StanisÅ‚aw <[email protected]> wrote:

> I have a class which defines object which can be stored in two
> different repositories, depending on some criteria. Now, each object
> has many associated objects (children) which are all in the same
> database as parent object is.
> The problem is how to implement that so parent object is looking for
> children in proper repository instead of default. Should I just simply
> rewrite child_object_name method or is there a better solution?

You can wrap it in a repository block, so something like the following
(not tested, semi pseudo code):

store = parent_obj.repository
repository(store.name) do
  # Code here will run in the store repository context
end

-- 
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