{"id":22052677,"url":"https://github.com/digitalnz/consyncful-tree","last_synced_at":"2026-04-25T16:35:35.681Z","repository":{"id":62559592,"uuid":"499346000","full_name":"DigitalNZ/consyncful-tree","owner":"DigitalNZ","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-07T03:24:36.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-01T04:13:43.883Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DigitalNZ.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2022-06-03T01:42:14.000Z","updated_at":"2022-06-08T00:03:42.000Z","dependencies_parsed_at":"2024-11-30T15:13:59.458Z","dependency_job_id":"8d25b399-c116-4604-a366-5ac8f1510047","html_url":"https://github.com/DigitalNZ/consyncful-tree","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":"0.024390243902439046","last_synced_commit":"fa62e846333d151c69bb0b5a4e48cbe3dccdacbb"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalNZ%2Fconsyncful-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalNZ%2Fconsyncful-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalNZ%2Fconsyncful-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalNZ%2Fconsyncful-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DigitalNZ","download_url":"https://codeload.github.com/DigitalNZ/consyncful-tree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122536,"owners_count":20564327,"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":[],"created_at":"2024-11-30T15:13:56.579Z","updated_at":"2026-04-25T16:35:35.653Z","avatar_url":"https://github.com/DigitalNZ.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Consyncful::Tree\n\nFor those already using the `consyncful` gem, `consyncful-tree` provides a few additional concerns to help with Consyncful models nested in a tree structure.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'consyncful-tree'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install consyncful-tree\n\n## Usage\n\n### Parent\nInclude the Consyncful::Tree::Parent concern in a Consyncful model that you want to keep track of the dependencies of.\n\n```\nclass ModelName \u003c Consyncful::Base\n  include Consyncful::Tree::Parent\n\n  ...\nend\n```\n\nThis will give you the following three methods that recursively traverse the `references_one` + `references_many` relationships:\n```\nlookup_child_model_ids\n\nlookup_child_models\n\nwith_child_class_of?\n```\n\n### Child\n\nInclude the Consyncful::Tree::Child concern in any Consyncful model that is a dependency of a Consyncful::Tree::Parent and that should touch that parent when it is updated.\n\n```\nclass ModelName \u003c Consyncful::Base\n  include Consyncful::Tree::Child\n\n  ...\nend\n```\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).  You'll need an account on [rubygems.org](https://rubygems.org), you'll also need a current owner of the gem to add you as an owner.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/DigitalNZ/consyncful-tree.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalnz%2Fconsyncful-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalnz%2Fconsyncful-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalnz%2Fconsyncful-tree/lists"}