Skip to content

Instantly share code, notes, and snippets.

@tierra
Created May 31, 2018 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tierra/37b68af56e4ea20525150f4974a0f876 to your computer and use it in GitHub Desktop.
Save tierra/37b68af56e4ea20525150f4974a0f876 to your computer and use it in GitHub Desktop.
ActiveSupport::Notifications.subscribe("sql.active_record") do |_, _, _, _, details|
if details[:sql] =~ /search_path/
puts details[:sql]
puts caller.join("\n")
puts "*" * 50
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment