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

Merge pull request #11226 from senny/remove_deprecated_distinct_option

Remove deprecated `:distinct` option from `Relation#count`.
* Remove deprecated `:distinct` option from `Relation#count`.
*Yves Senn*
* Removed deprecated methods `partial_updates`, `partial_updates?` and
`partial_updates=`.
......
......@@ -194,11 +194,6 @@ def perform_calculation(operation, column_name, options = {})
# If #count is used with #distinct / #uniq it is considered distinct. (eg. relation.distinct.count)
distinct = self.distinct_value
if options.has_key?(:distinct)
ActiveSupport::Deprecation.warn "The :distinct option for `Relation#count` is deprecated. " \
"Please use `Relation#distinct` instead. (eg. `relation.distinct.count`)"
distinct = options[:distinct]
end
if operation == "count"
if select_values.present?
......
......@@ -351,16 +351,6 @@ def test_count_with_column_parameter
assert_equal 5, Account.count(:firm_id)
end
def test_count_distinct_option_is_deprecated
assert_deprecated do
assert_equal 4, Account.select(:credit_limit).count(distinct: true)
end
assert_deprecated do
assert_equal 6, Account.select(:credit_limit).count(distinct: false)
end
end
def test_count_with_distinct
assert_equal 4, Account.select(:credit_limit).distinct.count
assert_equal 4, Account.select(:credit_limit).uniq.count
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册