diff options
author | Yves Senn <yves.senn@gmail.com> | 2012-11-11 17:15:26 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@garaio.com> | 2012-11-12 16:27:44 +0100 |
commit | 663d9ef67003d3bec44295d29f3c254951202926 (patch) | |
tree | c23d60d4b240a8025020703b8e4523e6dd7fdea1 /activerecord/test/cases | |
parent | d5ac2801d9ba6eea0add944e13ba8f5c8754f117 (diff) | |
download | rails-663d9ef67003d3bec44295d29f3c254951202926.tar.gz rails-663d9ef67003d3bec44295d29f3c254951202926.tar.bz2 rails-663d9ef67003d3bec44295d29f3c254951202926.zip |
`#pluck` can be used on a relation with `select` clause.
Closes #7551
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/calculations_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index abbf2a765e..65d28ea028 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -580,4 +580,10 @@ class CalculationsTest < ActiveRecord::TestCase assert_equal ["Over There"], Possession.pluck(:where) end + + def test_pluck_replaces_select_clause + taks_relation = Topic.select(:approved, :id).order(:id) + assert_equal [1,2,3,4], taks_relation.pluck(:id) + assert_equal [false, true, true, true], taks_relation.pluck(:approved) + end end |