Fix builds with ActiveRecord < 4.1 on Ruby 2.2