Permalink
Browse files

Merge pull request #11226 from senny/remove_deprecated_distinct_option

Remove deprecated `:distinct` option from `Relation#count`.
  • Loading branch information...
2 parents 2591618 + 2181832 commit b6e061459b6a53959e26f94a750ccc9528116e05 @rafaelfranca rafaelfranca committed Jul 1, 2013
@@ -1,3 +1,7 @@
+* 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

0 comments on commit b6e0614

Please sign in to comment.