Does anyone have a suggested method for temporarily uninstalling or disabling before_save filters (or any filters, for that matter)? I have tried using alias to insert a null filter for the times when I don''t want the before_save code run, but it isn''t quite working yet, and it makes thecode quite ugly. Thanks, Joe
This just sounds wrong. If you don''t want the filter to run, then maybe you should add more conditions to it, or simply do the appropriate checking in the filter''s method. Wouldn''t that make more sense? What''s the use case in which you need to disable a filter? The list could probably help you find an alternate and more elegant solution. Cheers, Ben On 4/20/05, Joseph Hosteny <jhosteny-ee4meeAH724@public.gmane.org> wrote:> Does anyone have a suggested method for temporarily uninstalling or > disabling before_save filters (or any filters, for that matter)? > > I have tried using alias to insert a null filter for the times when I > don''t want the before_save code run, but it isn''t quite working yet, > and it makes thecode quite ugly. > > Thanks, > Joe > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
return in the first line? On 4/20/05, Joseph Hosteny <jhosteny-ee4meeAH724@public.gmane.org> wrote:> Does anyone have a suggested method for temporarily uninstalling or > disabling before_save filters (or any filters, for that matter)? > > I have tried using alias to insert a null filter for the times when I > don''t want the before_save code run, but it isn''t quite working yet, > and it makes thecode quite ugly. > > Thanks, > Joe > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://www.snowdevil.ca - Snowboards that don''t suck http://www.hieraki.org - Open source book authoring http://blog.leetsoft.com - Technical weblog
That''s what I currently have in the code. I suppose I wrote the first email in haste - there''s probably no reason why that isn''t sufficient. Thanks, Joe On Apr 20, 2005, at 6:29 PM, Ben Schumacher wrote:> This just sounds wrong. If you don''t want the filter to run, then > maybe you should add more conditions to it, or simply do the > appropriate checking in the filter''s method. Wouldn''t that make more > sense? > > What''s the use case in which you need to disable a filter? The list > could probably help you find an alternate and more elegant solution. > > Cheers, > > Ben > > On 4/20/05, Joseph Hosteny <jhosteny-ee4meeAH724@public.gmane.org> wrote: >> Does anyone have a suggested method for temporarily uninstalling or >> disabling before_save filters (or any filters, for that matter)? >> >> I have tried using alias to insert a null filter for the times when I >> don''t want the before_save code run, but it isn''t quite working yet, >> and it makes thecode quite ugly. >> >> Thanks, >> Joe >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails