So i’ve been spending hours tracking this one down: I wanted to have cache sweepers in rails and followed the advice from railscasts and railsevny. Those tutorials tell you to put sweepers in an app/sweepers directory and add that directory to your load path. DON’T DO THAT. That simply did not work for me (using rails 2.02). After banging my head against google for hours, I found out that sweeper simply has to go in app/models, MVC be dammed. If they are put there they get loaded, and you can add them as active record observers. If they are not put there rails won’t find them. I don’t know if this is a bug or a feature, but that is just the way it is.
Popularity: 94% [?]
