Removed deprecation warnings in newer rails.