For Rails 3.2+