Added rails 3.2 compatibility
Added ruby 1.8.7 compatibility