fix middleware for AC::Metal on rails 3.2