On 1 Oct 2009, at 20:29, Luke Galea wrote:

> The repo_read, repo_write thing works for me. I think we'll have to
> hack the adapter to default to write for write ops, etc.
>
> Doesn't look like an especially easy way to do that.


Hmmm, you could try redefining Resource#save_self, how about this

   module DataMapper::Resource
     def save_self(safe = true)
       repository(:repo_write) do
         if safe
           new? ? create_hook : update_hook
         else
           new? ? _create : _update
         end
       end
     end
   end

?

Again, no idea if that will work or what the consequences might be  
(probably identity map carnage).  In fact I might go blind just  
looking at it...

HTH

Ashley

-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
http://aviewfromafar.net/








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