mislav/will_paginate — pull request #385 by epoplavskis (2014-06-12 17:15:09+00:00)
Title: Active record count fix for ruby 4.1.x

Moved from deprecated count method for rails 4.1. Previous code causes an sql syntax error when using "AS" for assigning temporary column name in a select statement.

'''
Venue.select('venues.*, name as venue_name').paginate(page: 1, per_page: 20)
"'

Related issues:
http://stackoverflow.com/questions/23523356/rails-4-1-1-w-pg-search-pgsyntaxerror-error-syntax-error-at-or-near-as
https://github.com/rails/rails/issues/13648