Automatically insert middleware when in a Rails project