instance method
exec_queries
Ruby on Rails 4.0.13
Since v3.2.22.5 Private — implementation detail, not part of the public APISignature
exec_queries()
No documentation comment.
Source
# File activerecord/lib/active_record/relation.rb, line 582
def exec_queries
default_scoped = with_default_scope
if default_scoped.equal?(self)
@records = eager_loading? ? find_with_associations : @klass.find_by_sql(arel, bind_values)
preload = preload_values
preload += includes_values unless eager_loading?
preload.each do |associations|
ActiveRecord::Associations::Preloader.new(@records, associations).run
end
# @readonly_value is true only if set explicitly. @implicit_readonly is true if there
# are JOINS and no explicit SELECT.
readonly = readonly_value.nil? ? @implicit_readonly : readonly_value
@records.each { |record| record.readonly! } if readonly
else
@records = default_scoped.to_a
end
@loaded = true
@records
end
Defined in activerecord/lib/active_record/relation.rb line 582
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation