Optimize for Rails 4