Hi Jonathan, Thanks for pointing dm-observer out. I am aware of it, and am also using it. I need the sweeper, in this case, to expire page caches, which is basically controller logic that needs to respond to the models lifecycle. So yeah, I wrote the sweeper to basically have an observer that runs in the context of the Rails controller, which is exactly what rails sweepers do.
Thanks for the reply though, -Amiel On Sat, May 7, 2011 at 1:51 AM, Jonathan Stott <[email protected]>wrote: > Hello Amiel > > I don't know if you're aware of this, but there is dm-observer too. > It might serve what you want? > > https://gist.github.com/960331 > > Regards > Jonathan > > > On 7 May 2011 00:51, Amiel Martin <[email protected]> wrote: > > Hello, > > > > I'm currently using DataMapper for a project with rails, and I need > > the rails concept of sweepers. > > > > Since I couldn't find anything existing that would fit my needs, I > > wrote a DataMapper::Sweeper. > > > > I've posted a gist here: https://gist.github.com/959857 > > > > I few things about it: > > > > * It is pretty Rails-centric as it is tightly integrated with the > > Rails controller. > > * Unlike other DM callbacks, Sweeper's callbacks cannot reference the > > observed object as self. I put a lot of thought into this api change, > > and there is a discussion about it in the gist. > > * I have not yet made a gem of it, but I could if others would find it > > useful. > > > > Feedback? > > > > -Amiel > > > > -- > > 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. > > > > > > -- > 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. > > -- 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.
