Permalink
Browse files

Merge pull request #12547 from derekprior/dp-fix-null-relation-pluck

Pluck on NullRelation should accept a list of columns
  • Loading branch information...
2 parents e3e3851 + 23dfc39 commit 9f80937e82bbb592023ac3186826b59730370902 @rafaelfranca rafaelfranca committed Oct 15, 2013
@@ -1,3 +1,10 @@
+* `NullRelation#pluck` takes a list of columns
+
+ The method signature in `NullRelation` was updated to mimic that in
+ `Calculations`.
+
+ *Derek Prior*
+
* `scope_chain` should not be mutated for other reflections.
Currently `scope_chain` uses same array for building different
@@ -6,7 +6,7 @@ def exec_queries
@records = []
end
- def pluck(_column_name)
+ def pluck(*column_names)
[]
end
@@ -274,7 +274,7 @@ def test_none_chainable_to_existing_scope_extension_method
def test_none_chained_to_methods_firing_queries_straight_to_db
assert_no_queries do
- assert_equal [], Developer.none.pluck(:id) # => uses select_all
+ assert_equal [], Developer.none.pluck(:id, :name)
assert_equal 0, Developer.none.delete_all
assert_equal 0, Developer.none.update_all(:name => 'David')
assert_equal 0, Developer.none.delete(1)

0 comments on commit 9f80937

Please sign in to comment.