diff options
author | kennyj <kennyj@gmail.com> | 2012-02-25 23:01:43 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-02-25 23:01:43 +0900 |
commit | 404b73bce1f9347ca05b1496db8fc64438d66bd2 (patch) | |
tree | 5ce9e6aa1390115d9ee9f34767e8416c80ecf478 /activerecord/test | |
parent | 862e27fbbb31923c1e56b669914b24a3073674b4 (diff) | |
download | rails-404b73bce1f9347ca05b1496db8fc64438d66bd2.tar.gz rails-404b73bce1f9347ca05b1496db8fc64438d66bd2.tar.bz2 rails-404b73bce1f9347ca05b1496db8fc64438d66bd2.zip |
Remove NULLS FIRST/LAST. closes #5152
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb index 898d28456b..a71d0bb848 100644 --- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb +++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb @@ -185,6 +185,11 @@ module ActiveRecord assert_equal "(number > 100)", index.where end + def test_distinct_with_nulls + assert_equal "DISTINCT posts.title, posts.updater_id AS alias_0", @connection.distinct("posts.title", ["posts.updater_id desc nulls first"]) + assert_equal "DISTINCT posts.title, posts.updater_id AS alias_0", @connection.distinct("posts.title", ["posts.updater_id desc nulls last"]) + end + private def insert(ctx, data) binds = data.map { |name, value| |