fix middleware for AC::Metal on rails 3.2

Fixes #248