aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/null_relation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/null_relation.rb')
-rw-r--r--activerecord/lib/active_record/null_relation.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/null_relation.rb b/activerecord/lib/active_record/null_relation.rb
index 711fc8b883..5b255c3fe5 100644
--- a/activerecord/lib/active_record/null_relation.rb
+++ b/activerecord/lib/active_record/null_relation.rb
@@ -6,7 +6,7 @@ module ActiveRecord
@records = []
end
- def pluck(_column_name)
+ def pluck(*column_names)
[]
end
@@ -39,11 +39,7 @@ module ActiveRecord
end
def to_sql
- @to_sql ||= ""
- end
-
- def where_values_hash
- {}
+ ""
end
def count(*)
@@ -54,8 +50,14 @@ module ActiveRecord
0
end
- def calculate(_operation, _column_name, _options = {})
- nil
+ def calculate(operation, _column_name, _options = {})
+ # TODO: Remove _options argument as soon we remove support to
+ # activerecord-deprecated_finders.
+ if operation == :count
+ 0
+ else
+ nil
+ end
end
def exists?(_id = false)