提交 23dfc39e 编写于 作者: D Derek Prior

Pluck on NullRelation accepts a list of columns

`pluck` was updated to accept a list of columns, but the `NullRelation`
was never updated to match that signature. As a result, calling `pluck`
on a `NullRelation` results in an `ArgumentError`.
上级 dd37ff81
* `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.
先完成此消息的编辑!
想要评论请 注册