Avoiding Rails 4 deprecation warnings