Fixed bug on Rails 3.2.11