Worked around deprecation warnings in Rails 4.2.