Now supports ActiveRecord 3.2.15 (at least)

ActiveRecord::NamedScope was removed somewhere between ActiveRecord 2.3
and 3.2.x. This commit allows to_api to work in newer versions that no
longer have ActiveRecord::NamedScope. It should still work with the
versions it used to work with as well.

This version has also been tested with Ruby 1.9.3.