Class: ActiveRecord::Relation::ExplainProxy
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | activerecord/lib/active_record/relation.rb |
Class Method Summary
- .new(relation, options) ⇒ ExplainProxy constructor
Instance Method Summary
Constructor Details
.new(relation, options) ⇒ ExplainProxy
# File 'activerecord/lib/active_record/relation.rb', line 7
def initialize(relation, ) @relation = relation @options = end
Instance Method Details
#average(column_name)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 16
def average(column_name) exec_explain { @relation.average(column_name) } end
#count(column_name = nil)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 20
def count(column_name = nil) exec_explain { @relation.count(column_name) } end
#exec_explain(&block) (private)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 49
def exec_explain(&block) @relation.exec_explain(@relation.collecting_queries_for_explain { block.call }, @options) end
#first(limit = nil)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 24
def first(limit = nil) exec_explain { @relation.first(limit) } end
#inspect
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 12
def inspect exec_explain { @relation.send(:exec_queries) } end
#last(limit = nil)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 28
def last(limit = nil) exec_explain { @relation.last(limit) } end
#maximum(column_name)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 32
def maximum(column_name) exec_explain { @relation.maximum(column_name) } end
#minimum(column_name)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 36
def minimum(column_name) exec_explain { @relation.minimum(column_name) } end
#pluck(*column_names)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 40
def pluck(*column_names) exec_explain { @relation.pluck(*column_names) } end
#sum(identity_or_column = nil)
[ GitHub ]# File 'activerecord/lib/active_record/relation.rb', line 44
def sum(identity_or_column = nil) exec_explain { @relation.sum(identity_or_column) } end