提交 9f80937e 编写于 作者: R Rafael Mendonça França

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

Pluck on NullRelation should accept a list of columns
* `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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册