Skip to content

Instantly share code, notes, and snippets.

View lsylvester's full-sized avatar

Lachlan Sylvester lsylvester

View GitHub Profile
DependencyDetection.defer do
@name = :net
depends_on do
defined?(HTTPI)
end
executes do
NewRelic::Agent.logger.debug "Installing HTTPI instrumentation"
end
## Original
def orig_reverse_sql_order(order_query)
order_query.join(', ').split(',').collect { |s|
if s.match(/\s(asc|ASC)$/)
s.gsub(/\s(asc|ASC)$/, ' DESC')
elsif s.match(/\s(desc|DESC)$/)
s.gsub(/\s(desc|DESC)$/, ' ASC')
else
s + ' DESC'
end