Class: ActiveRecord::Relation::ExplainProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/relation.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(relation, options) ⇒ ExplainProxy

Returns a new instance of ExplainProxy.



7
8
9
10
# File 'lib/active_record/relation.rb', line 7

def initialize(relation, options)
  @relation = relation
  @options  = options
end

Instance Method Details

#average(column_name) ⇒ Object



16
17
18
# File 'lib/active_record/relation.rb', line 16

def average(column_name)
  exec_explain { @relation.average(column_name) }
end

#count(column_name = nil) ⇒ Object



20
21
22
# File 'lib/active_record/relation.rb', line 20

def count(column_name = nil)
  exec_explain { @relation.count(column_name) }
end

#first(limit = nil) ⇒ Object



24
25
26
# File 'lib/active_record/relation.rb', line 24

def first(limit = nil)
  exec_explain { @relation.first(limit) }
end

#inspectObject



12
13
14
# File 'lib/active_record/relation.rb', line 12

def inspect
  exec_explain { @relation.send(:exec_queries) }
end

#last(limit = nil) ⇒ Object



28
29
30
# File 'lib/active_record/relation.rb', line 28

def last(limit = nil)
  exec_explain { @relation.last(limit) }
end

#maximum(column_name) ⇒ Object



32
33
34
# File 'lib/active_record/relation.rb', line 32

def maximum(column_name)
  exec_explain { @relation.maximum(column_name) }
end

#minimum(column_name) ⇒ Object



36
37
38
# File 'lib/active_record/relation.rb', line 36

def minimum(column_name)
  exec_explain { @relation.minimum(column_name) }
end

#pluck(*column_names) ⇒ Object



40
41
42
# File 'lib/active_record/relation.rb', line 40

def pluck(*column_names)
  exec_explain { @relation.pluck(*column_names) }
end

#sum(identity_or_column = nil) ⇒ Object



44
45
46
# File 'lib/active_record/relation.rb', line 44

def sum(identity_or_column = nil)
  exec_explain { @relation.sum(identity_or_column) }
end