From: Eloy D. <e....@su...> - 2008-01-28 19:54:07
|
Hi Cory, There's indeed no other way yet to do it then you have done with rbSetValue_forKey. There is only on_get for when data is being requested. I'm interested to see the code on how you did it, so we could maybe turn it into a nicer solution. About creating records from your code, you can simply use the normal way of doing this with AR. So: Mailbox.create etc. But if you're gonna add it to a ActiveRecordSetController, or anything other related to bindings, you'll need a proxy. You can use #to_activerecord_proxy on the AR instance, or create it in one go with: MailboxProxy.create etc. You can than add it to the ActiveRecordSetController with #addObject(proxy). Cheers, Eloy On 28 jan 2008, at 20:37, Cory Loken wrote: > I am just beginning to explore the ActiveRecord support in RubyCocoa. > Everything works great when I want to allow everything to be handled > by AR, but there are a few cases where I would like to manipulate the > data before the records are created, modified, or destroyed. In one > case I would like to update a cell if another column in that row is > modified. I've managed to do this by creating my own rbSetValue_forKey > method and then calling the super method if I don't need to do > anything special. I am totally lost however on what to do when I want > to create my own record from values in my script or delete a record > manually. Is this documented anywhere or does anyone have a suggestion > on how I might do this? > > Thanks for any info. > > Cory > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |