Migrated from Rails 3.2 to 4.0