Flowdock
method

exec_queries

Importance_0
exec_queries(&block) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation.rb, line 795
      def exec_queries(&block)
        skip_query_cache_if_necessary do
          @records =
            if eager_loading?
              apply_join_dependency do |relation, join_dependency|
                if relation.null_relation?
                  []
                else
                  relation = join_dependency.apply_column_aliases(relation)
                  rows = connection.select_all(relation.arel, "SQL")
                  join_dependency.instantiate(rows, &block)
                end.freeze
              end
            else
              klass.find_by_sql(arel, &block).freeze
            end

          preload_associations(@records) unless skip_preloading_value

          @records.each(&:readonly!) if readonly_value

          @loaded = true
          @records
        end
      end
Register or log in to add new notes.