{"id":13877953,"url":"https://github.com/pocke/activerecord-originator","last_synced_at":"2025-10-31T14:30:29.032Z","repository":{"id":227458229,"uuid":"770972751","full_name":"pocke/activerecord-originator","owner":"pocke","description":"A RubyGem adding SQL comments to indicate the origin of the SQL","archived":false,"fork":false,"pushed_at":"2024-08-14T13:45:04.000Z","size":53,"stargazers_count":72,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T20:12:05.069Z","etag":null,"topics":["activerecord","ruby-gem","ruby-on-rails","sql"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pocke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-12T13:17:53.000Z","updated_at":"2024-12-04T10:44:43.000Z","dependencies_parsed_at":"2024-03-20T09:50:33.088Z","dependency_job_id":"357bf527-c21d-4b99-817d-27e07a741390","html_url":"https://github.com/pocke/activerecord-originator","commit_stats":null,"previous_names":["pocke/activerecord-originator"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocke%2Factiverecord-originator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocke%2Factiverecord-originator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocke%2Factiverecord-originator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocke%2Factiverecord-originator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocke","download_url":"https://codeload.github.com/pocke/activerecord-originator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239195471,"owners_count":19598037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activerecord","ruby-gem","ruby-on-rails","sql"],"created_at":"2024-08-06T08:01:35.855Z","updated_at":"2025-10-31T14:30:28.984Z","avatar_url":"https://github.com/pocke.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# ActiveRecord::Originator\n\nAdd SQL comments to indicate the origin of the SQL.\n\nThis gem adds SQL comments indicating the origin of the part of the query. This is useful for debugging large queries.\n\nRails tells us where the SQL is executed, but it doesn't tell us where the SQL is constructed.\nThis gem lets you know where the SQL is constructed! For example:\n\n```sql\nArticle Load (0.1ms)  SELECT \"articles\".* FROM \"articles\" WHERE \"articles\".\"status\" = ? /* app/models/article.rb:3:in `published' */\n AND \"articles\".\"category_id\" = ? /* app/controllers/articles_controller.rb:3:in `index' */\n ORDER BY \"articles\".\"created_at\" DESC /* app/models/article.rb:4:in `order_by_latest' */\n```\n\nYou can see where `.where` and `.order` methods are called without reading the source code. It is helpful if the query builder is complex.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n```console\n$ bundle add activerecord-originator\n```\n\nYou do not need to do anything else. The gem will automatically add comments to the SQL.\nCheck the logs to see the comments.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/pocke/activerecord-originator.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocke%2Factiverecord-originator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocke%2Factiverecord-originator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocke%2Factiverecord-originator/lists"}