Fix Rails 4 detection