{"id":24548172,"url":"https://github.com/flanker/acts_as_graph","last_synced_at":"2025-07-15T10:02:47.278Z","repository":{"id":59150427,"uuid":"132840112","full_name":"flanker/acts_as_graph","owner":"flanker","description":"Add graph(DAG) support to your Ruby models","archived":false,"fork":false,"pushed_at":"2021-04-28T01:38:58.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T03:53:01.400Z","etag":null,"topics":["ruby","rubygem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/acts_as_graph","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/flanker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-10T02:52:06.000Z","updated_at":"2021-04-28T02:04:53.000Z","dependencies_parsed_at":"2022-09-13T10:50:13.886Z","dependency_job_id":null,"html_url":"https://github.com/flanker/acts_as_graph","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/flanker/acts_as_graph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanker%2Facts_as_graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanker%2Facts_as_graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanker%2Facts_as_graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanker%2Facts_as_graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flanker","download_url":"https://codeload.github.com/flanker/acts_as_graph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanker%2Facts_as_graph/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265426798,"owners_count":23763159,"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":["ruby","rubygem"],"created_at":"2025-01-22T23:16:16.579Z","updated_at":"2025-07-15T10:02:47.229Z","avatar_url":"https://github.com/flanker.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# acts_as_graph\n\n[![Build Status](https://travis-ci.com/flanker/acts_as_graph.svg?branch=master)](https://travis-ci.com/flanker/acts_as_graph)\n\nA very simple acts as graph for your model\n\nrubygems.org link: https://rubygems.org/gems/acts_as_graph\n\n## How to use\n\nIf you have a model like this code below:\n\n```ruby\nclass Task\n\n  attr_reader :title\n  attr_accessor :depended_tasks\n\n  def initialize title, depended_tasks = []\n    @title = title\n    @depended_tasks = depended_tasks\n  end\n\nend\n```\n\nThen you could use `acts_as_graph`\n\n```ruby\nclass Task\n\n  include ActsAsGraph\n\n  acts_as_graph children: :depended_tasks\n\n  attr_reader :title\n  attr_accessor :depended_tasks\n\n  def initialize title, depended_tasks = []\n    @title = title\n    @depended_tasks = depended_tasks\n  end\n\nend\n```\n\nAnd Then:\n\n```ruby\ntask.descendant_depended_tasks    # returns all the descendant\n\ntask.has_circular_reference?    # check if descendant has circular reference\n```\n\n[Check unit tests for more information](https://github.com/flanker/acts_as_graph/blob/master/spec/acts_as_graph_spec.rb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflanker%2Facts_as_graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflanker%2Facts_as_graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflanker%2Facts_as_graph/lists"}