I learned you can add pretty specific comments about the source of SQL queries in a rails app by adding the marginalia gem to your project.
This makes it easier to tie specific queries or updates to the location in the code that called them:
Profile Create (0.6ms) INSERT INTO "profiles" ("created_at", "updated_at", "user_id") VALUES ($1, $2, $3) RETURNING "id" /*line:/app/models/user.rb:20:in `block (3 levels) in <class:User>'*/ [["created_at", "2021-10-13 16:56:31.006007"], ["updated_at", "2021-10-13 16:56:31.006007"], ["user_id", 218762]]
Now, I can that this profile creation was triggered by code on line 20 in the User class definition...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I learned you can add pretty specific comments about the source of SQL queries in a rails app by adding the marginalia gem to your project.
This makes it easier to tie specific queries or updates to the location in the code that called them:
Now, I can that this profile creation was triggered by code on line 20 in the User class definition...