diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-08-02 07:53:47 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-08-02 07:53:47 -0700 |
commit | 59c4b22c4528e9f97d3eb394f603dc50c3cf41a9 (patch) | |
tree | 35d277f0277146546f22363ff6f36a5e0e7b8d0e /activerecord/test | |
parent | 5365c10a1f911c24b3e81bfd930b77665556086a (diff) | |
parent | f137c2b838773be3cfa916e9f7a91773b9245bda (diff) | |
download | rails-59c4b22c4528e9f97d3eb394f603dc50c3cf41a9.tar.gz rails-59c4b22c4528e9f97d3eb394f603dc50c3cf41a9.tar.bz2 rails-59c4b22c4528e9f97d3eb394f603dc50c3cf41a9.zip |
Merge pull request #7232 from kennyj/fix_7200
Fix #7200. Backport #5168 to 3-2-stable
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 d57794daf8..3eb73d3093 100644 --- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb +++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb @@ -179,6 +179,11 @@ module ActiveRecord assert_equal Arel.sql('$2'), bind 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| |