Fix Rails 4 beta support