You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.
$ 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]
This should Resolveactiverecord-hackery#418
Since the 4.1 version of `reverse_order!` is used, an additional check has been
added to actually reorder the `ORDER BY` clause if there are non-nil elements
of it.
A spec has been written to support this change.
yez
pushed a commit
to yez/squeel
that referenced
this issue
Apr 15, 2016
This should Resolveactiverecord-hackery#418
Since the 4.1 version of `reverse_order!` is used, an additional check has been
added to actually reorder the `ORDER BY` clause if there are non-nil elements
of it.
Additionally, a spec has been added to ensure proper ordering takes place.
This should Resolveactiverecord-hackery#418
Since the 4.1 version of `reverse_order!` is used, an additional check has been
added to actually reorder the `ORDER BY` clause if there are non-nil elements
of it.
Additionally, a spec has been added to ensure proper ordering takes place.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 rails/rails#24442 and rails/rails#24443
The text was updated successfully, but these errors were encountered: