Module: ActiveRecord::NullRelation
- Defined in:
- activerecord/lib/active_record/null_relation.rb
Overview
:nodoc:
Instance Method Summary collapse
- #any? ⇒ Boolean
- #calculate(_operation, _column_name, _options = {}) ⇒ Object
- #count ⇒ Object
- #delete(_id_or_array) ⇒ Object
- #delete_all(_conditions = nil) ⇒ Object
- #empty? ⇒ Boolean
- #exec_queries ⇒ Object
- #exists?(_id = false) ⇒ Boolean
- #many? ⇒ Boolean
- #pluck(_column_name) ⇒ Object
- #size ⇒ Object
- #sum ⇒ Object
- #to_sql ⇒ Object
- #update_all(_updates, _conditions = nil, _options = {}) ⇒ Object
- #where_values_hash ⇒ Object
Instance Method Details
#any? ⇒ Boolean
33 34 35 |
# File 'activerecord/lib/active_record/null_relation.rb', line 33 def any? false end |
#calculate(_operation, _column_name, _options = {}) ⇒ Object
57 58 59 60 61 62 63 |
# File 'activerecord/lib/active_record/null_relation.rb', line 57 def calculate(_operation, _column_name, = {}) if _operation == :count 0 else nil end end |
#count ⇒ Object
49 50 51 |
# File 'activerecord/lib/active_record/null_relation.rb', line 49 def count(*) 0 end |
#delete(_id_or_array) ⇒ Object
21 22 23 |
# File 'activerecord/lib/active_record/null_relation.rb', line 21 def delete(_id_or_array) 0 end |
#delete_all(_conditions = nil) ⇒ Object
13 14 15 |
# File 'activerecord/lib/active_record/null_relation.rb', line 13 def delete_all(_conditions = nil) 0 end |
#empty? ⇒ Boolean
29 30 31 |
# File 'activerecord/lib/active_record/null_relation.rb', line 29 def empty? true end |
#exec_queries ⇒ Object
5 6 7 |
# File 'activerecord/lib/active_record/null_relation.rb', line 5 def exec_queries @records = [] end |
#exists?(_id = false) ⇒ Boolean
65 66 67 |
# File 'activerecord/lib/active_record/null_relation.rb', line 65 def exists?(_id = false) false end |
#many? ⇒ Boolean
37 38 39 |
# File 'activerecord/lib/active_record/null_relation.rb', line 37 def many? false end |
#pluck(_column_name) ⇒ Object
9 10 11 |
# File 'activerecord/lib/active_record/null_relation.rb', line 9 def pluck(_column_name) [] end |
#size ⇒ Object
25 26 27 |
# File 'activerecord/lib/active_record/null_relation.rb', line 25 def size 0 end |
#sum ⇒ Object
53 54 55 |
# File 'activerecord/lib/active_record/null_relation.rb', line 53 def sum(*) 0 end |
#to_sql ⇒ Object
41 42 43 |
# File 'activerecord/lib/active_record/null_relation.rb', line 41 def to_sql "" end |
#update_all(_updates, _conditions = nil, _options = {}) ⇒ Object
17 18 19 |
# File 'activerecord/lib/active_record/null_relation.rb', line 17 def update_all(_updates, _conditions = nil, = {}) 0 end |
#where_values_hash ⇒ Object
45 46 47 |
# File 'activerecord/lib/active_record/null_relation.rb', line 45 def where_values_hash {} end |