{"id":19667246,"url":"https://github.com/willnet/save_chain_inspector","last_synced_at":"2025-10-07T19:46:02.067Z","repository":{"id":250546404,"uuid":"834778817","full_name":"willnet/save_chain_inspector","owner":"willnet","description":"A tool to investigate the order in which the saves of related models are executed.","archived":false,"fork":false,"pushed_at":"2024-09-03T07:01:53.000Z","size":28,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T16:43:38.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/willnet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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-07-28T10:36:18.000Z","updated_at":"2024-09-14T09:22:19.000Z","dependencies_parsed_at":"2024-07-28T10:53:43.134Z","dependency_job_id":"add20606-d48a-4123-9f66-30987db26ddb","html_url":"https://github.com/willnet/save_chain_inspector","commit_stats":null,"previous_names":["willnet/save_chain_inspector"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/willnet/save_chain_inspector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fsave_chain_inspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fsave_chain_inspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fsave_chain_inspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fsave_chain_inspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willnet","download_url":"https://codeload.github.com/willnet/save_chain_inspector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Fsave_chain_inspector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278577932,"owners_count":26009701,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T16:31:20.176Z","updated_at":"2025-10-07T19:46:02.029Z","avatar_url":"https://github.com/willnet.png","language":"Ruby","readme":"# SaveChainInspector\n\nWhen you execute save on a model in Active Record, the saves of related models with pre-set hooks are also executed. SaveChainInspector provides a way to know which models and which hooks have been executed specifically.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add save_chain_inspector --group=development,test\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install save_chain_inspector\n\n## Usage\n\n`SaveChainInspector.start` takes a block. It outputs the execution order of the save chain to the standard output.\n\n```ruby      \nSaveChainInspector.start do\n  post = Post.new\n  post.comments.build\n  post.save\nend\n```\n\n```\nPost#save start\n  Post#before_save start\n  Post#before_save end\n  Post#after_create start\n    Post#autosave_associated_records_for_comments start\n      Comment#save start\n        Comment#before_save start\n          Comment#autosave_associated_records_for_post start\n          Comment#autosave_associated_records_for_post end\n        Comment#before_save end\n        Comment#after_create start\n        Comment#after_create end\n      Comment#save end\n    Post#autosave_associated_records_for_comments end\n  Post#after_create end\nPost#save end\n```\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/willnet/save_chain_inspector. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/willnet/save_chain_inspector/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the SaveChainInspector project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/willnet/save_chain_inspector/blob/main/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillnet%2Fsave_chain_inspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillnet%2Fsave_chain_inspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillnet%2Fsave_chain_inspector/lists"}