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.rb57
1 files changed, 54 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/null_relation.rb b/activerecord/lib/active_record/null_relation.rb
index 60c37ac2b7..4c1c91e3df 100644
--- a/activerecord/lib/active_record/null_relation.rb
+++ b/activerecord/lib/active_record/null_relation.rb
@@ -1,10 +1,61 @@
# -*- coding: utf-8 -*-
module ActiveRecord
- # = Active Record Null Relation
- class NullRelation < Relation
+ module NullRelation # :nodoc:
def exec_queries
@records = []
end
+
+ def pluck(_column_name)
+ []
+ end
+
+ def delete_all(_conditions = nil)
+ 0
+ end
+
+ def update_all(_updates, _conditions = nil, _options = {})
+ 0
+ end
+
+ def delete(_id_or_array)
+ 0
+ end
+
+ def size
+ 0
+ end
+
+ def empty?
+ true
+ end
+
+ def any?
+ false
+ end
+
+ def many?
+ false
+ end
+
+ def to_sql
+ @to_sql ||= ""
+ end
+
+ def where_values_hash
+ {}
+ end
+
+ def count
+ 0
+ end
+
+ def calculate(_operation, _column_name, _options = {})
+ nil
+ end
+
+ def exists?(_id = false)
+ false
+ end
end
-end \ No newline at end of file
+end