$ rails new demo
$ cd demo
$ rails g model Person
$ rake db:migrate
$ rails c
> Person.reorder(:id).last
# SELECT "people".* FROM "people" ORDER BY "people"."id" DESC LIMIT 1
#=> nil
# add "gem 'squeel'" to Gemfile
$ bundle install
$ rails c
> Person.reorder(:id).last
# SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
#=> nil
Expected behavior
> Person.reorder(:id).last
# SELECT "people".* FROM "people" ORDER BY "people"."id" DESC LIMIT 1
#=> nil
Actual behavior
> Person.reorder(:id).last
# SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
#=> nil
System configuration
Rails version: 4.2.6 (as well as 4.2.5.2)
Ruby version: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
Steps to reproduce
Expected behavior
Actual behavior
System configuration
Rails version: 4.2.6 (as well as 4.2.5.2) Ruby version: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
PS: This issue supersedes https://github.com/rails/rails/issues/24442 and https://github.com/rails/rails/issues/24443