A small Rails debugging tool: automatically log the full SQL statement when PostgreSQL errors occur. No setup required — in development and test, whenever a query fails, the full SQL will be logged: ...