method

lookup_sql_cache

lookup_sql_cache(sql, name, binds)
private

No documentation available.

# File activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb, line 120
        def lookup_sql_cache(sql, name, binds)
          key = binds.empty? ? sql : [sql, binds]
          hit = false
          result = nil

          @lock.synchronize do
            if (result = @query_cache.delete(key))
              hit = true
              @query_cache[key] = result
            end
          end

          if hit
            ActiveSupport::Notifications.instrument(
              "sql.active_record",
              cache_notification_info(sql, name, binds)
            )

            result
          end
        end