{"id":31528920,"url":"https://github.com/kamaroly/ash_parental","last_synced_at":"2026-01-20T16:55:07.117Z","repository":{"id":312831760,"uuid":"1048863306","full_name":"kamaroly/ash_parental","owner":"kamaroly","description":"An Ash Extension that adds parent-child relationship to your  resource.","archived":false,"fork":false,"pushed_at":"2025-09-02T10:19:18.000Z","size":90,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-04T00:59:36.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/kamaroly.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-02T06:23:04.000Z","updated_at":"2025-09-22T02:29:35.000Z","dependencies_parsed_at":"2025-09-02T09:38:01.752Z","dependency_job_id":"b40cab67-205b-44bb-8d84-50cf82c49d88","html_url":"https://github.com/kamaroly/ash_parental","commit_stats":null,"previous_names":["kamaroly/ash_parental"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kamaroly/ash_parental","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaroly%2Fash_parental","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaroly%2Fash_parental/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaroly%2Fash_parental/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaroly%2Fash_parental/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamaroly","download_url":"https://codeload.github.com/kamaroly/ash_parental/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamaroly%2Fash_parental/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279009061,"owners_count":26084549,"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-11T02:00:06.511Z","response_time":55,"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":"2025-10-04T00:59:29.576Z","updated_at":"2025-10-11T22:21:06.222Z","avatar_url":"https://github.com/kamaroly.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Getting Started With Ash Parental\n\n![Alt text](https://raw.githubusercontent.com/kamaroly/ash_parental/refs/heads/master/logos/ash-parental-logo.png)\n\nAsh Parental is an Ash Framework extension that brings STI(Single Table Inheritance) capability to your resource. \n\nIf you want to learn how to build Ash extensions like this you can read more in the Ash Framework for Phoenix Developers serie on medium https://medium.com/p/62b58b426246.\n\n## What is a single table inheritance (STI)?\n\nIt's a fancy name for a simple concept: Extending a resource (usually to add specific behavior), but referencing the same table.\n\n## Installation\n\nThe package can be installed by adding `ash_parental` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ash_parental, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nThen add it to your resource like below\n\n```elixir\ndefmodule MyApp.Comment do\n    use Ash.Resource, extensions: [AshParental]\n    ....\nend\n```\n\n## What AshParental Does\n\nThis extension adds:\n\n1. `parent_id` attributes to your resource\n2. belongs to `parent` relationship\n3. has many `children` relationship\n4. `children_count` aggregates\n\n## Configurations\n\nIt comes with 2 configurations:\n\n1. `children_relationship_name` to rename children relationship name\n2. `destroy_with_children?` to indicate whether or not parents should be destroyed with their children\n\n```elixir\n  defmodule MyApp.Comment do\n    use Ash.Resource,\n      domain: MyApp.Domain,\n      data_layer: Ash.DataLayer.Ets,\n      # \u003c--- Add AshParental to your resource\n      extensions: [AshParental]\n\n    ets do\n      table :comments\n    end\n\n    # \u003c--- Configure Ash Parental\n    ash_parental do\n      children_relationship_name :replies # Default: children \n      destroy_with_children? true # Default: false\n    end\n\n    actions do\n      defaults [:create, :read, :update, :destroy] \n    end\n\n    attributes do\n      uuid_primary_key :id\n      attribute :content, :string, allow_nil?: false\n      timestamps()\n    end\n  end\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamaroly%2Fash_parental","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamaroly%2Fash_parental","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamaroly%2Fash_parental/lists"}