Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

makes #reorder break #last #418

Description

@adrianomitre

Steps to reproduce

$ 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]

PS: This issue supersedes rails/rails#24442 and rails/rails#24443

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions