{"id":15792859,"url":"https://github.com/delonnewman/activerecord-pull","last_synced_at":"2025-10-28T01:49:00.148Z","repository":{"id":46902533,"uuid":"242240691","full_name":"delonnewman/activerecord-pull","owner":"delonnewman","description":"A simple query interface for pulling deeply nested data from records.","archived":false,"fork":false,"pushed_at":"2024-08-22T18:56:54.000Z","size":33,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-04T00:00:42.110Z","etag":null,"topics":["activerecord","activerecord-queries","database","declarative-programming","eav-model","graph","nested-objects","nested-structures","object-oriented-programming","ontology","query","querying","relational","relational-database","relational-databases","ruby","ruby-on-rails","sql-databases","tree","trees"],"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/delonnewman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-02-21T22:20:10.000Z","updated_at":"2025-02-20T16:51:53.000Z","dependencies_parsed_at":"2024-11-02T06:02:02.448Z","dependency_job_id":null,"html_url":"https://github.com/delonnewman/activerecord-pull","commit_stats":{"total_commits":18,"total_committers":3,"mean_commits":6.0,"dds":0.4444444444444444,"last_synced_commit":"4e17b0932bd6d3310008d3b0a85f7c6e228e40e3"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/delonnewman/activerecord-pull","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Factiverecord-pull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Factiverecord-pull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Factiverecord-pull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Factiverecord-pull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delonnewman","download_url":"https://codeload.github.com/delonnewman/activerecord-pull/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Factiverecord-pull/sbom","scorecard":{"id":333198,"data":{"date":"2025-08-11","repo":{"name":"github.com/delonnewman/activerecord-pull","commit":"4e17b0932bd6d3310008d3b0a85f7c6e228e40e3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":8,"reason":"dependency not pinned by hash detected -- score normalized to 8","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ruby.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/delonnewman/activerecord-pull/ruby.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/ruby.yml:17","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-76r7-hhxj-r776","Warn: Project is vulnerable to: GHSA-cr5q-6q9f-rq6q","Warn: Project is vulnerable to: GHSA-2rxp-v6pw-ch6m","Warn: Project is vulnerable to: GHSA-4xqq-m2hx-25v8","Warn: Project is vulnerable to: GHSA-5866-49gr-22v4","Warn: Project is vulnerable to: GHSA-r55c-59qm-vjw6","Warn: Project is vulnerable to: GHSA-vg3r-rm7w-2xgh","Warn: Project is vulnerable to: GHSA-vmwr-mc7x-5vc3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T04:04:31.164Z","repository_id":46902533,"created_at":"2025-08-18T04:04:31.165Z","updated_at":"2025-08-18T04:04:31.165Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281371741,"owners_count":26489526,"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-27T02:00:05.855Z","response_time":61,"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":["activerecord","activerecord-queries","database","declarative-programming","eav-model","graph","nested-objects","nested-structures","object-oriented-programming","ontology","query","querying","relational","relational-database","relational-databases","ruby","ruby-on-rails","sql-databases","tree","trees"],"created_at":"2024-10-04T23:05:58.102Z","updated_at":"2025-10-28T01:49:00.130Z","avatar_url":"https://github.com/delonnewman.png","language":"Ruby","readme":"[![Ruby](https://github.com/delonnewman/activerecord-pull/actions/workflows/ruby.yml/badge.svg)](https://github.com/delonnewman/activerecord-pull/actions/workflows/ruby.yml)\n\n# ActiveRecord::Pull::Alpha\n\nA simple query interface for pulling deeply nested data from records.\n\n## Synopsis\n\n```ruby\n  class Survey \u003c ActiveRecord::Base\n    has_many :questions\n    has_many :responses\n  end\n\n  class Question \u003c ActiveRecord::Base\n    has_many :answers\n  end\n\n  class Answer \u003c ActiveRecord::Base\n    belongs_to :reply\n    belongs_to :question\n  end\n\n  class Response \u003c ActiveRecord::Base\n    belongs_to :survey\n    has_many :answers\n  end\n\n  Survey.find(34).pull(:name, questions: [:text, answers: [:created_at]])\n  Response.where('created_at \u003c ?', Date.new(2018, 7, 5)).pull({ survey: :name }, { answers: :value }) \n```\n\n## Why?\n\nWhen using an SQL database modeling [trees][tree] and [ontologies][ontology] is an exercise in relational database design.\nUnfortunately, when dealing with deeply nested and *overlapping* data (e.g. medical records and social graphs)\ntrees and ontologies won't do. We need to model graphs, a much more sparsely structured data model, but\nthis leads to very complex (or sparse) table structures and very complex SQL queries.\n\nAlternatives to SQL databases like [Datomic][datomic], [RDF][rdf] and graph databases resolve this problem in the general case,\nbut sometimes those solutions are not a viable option for one reason or another. This gem attempts to provide some of the\nconvenience of these solutions as an extension to ActiveRecord. As a bonus it makes querying trees and ontologies simple too!\n\n## Pull Syntax\n\nThe pull syntax is inspired by the pull syntax that is used in [Datomic][datomic-pull].\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'activerecord-pull-alpha'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install activerecord-pull-alpha\n\n## See Also\n\n- [Ancestry](https://github.com/stefankroes/ancestry)\n- [Graphiti](https://www.graphiti.dev/)\n- [Datomic][datomic]\n- [GraphQL](https://graphql.org/)\n- [Entity Attribute Value Model][eav-model]\n- [RDF][rdf]\n- [A City is Not a Tree](https://www.patternlanguage.com/archive/cityisnotatree.html)\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[datomic]: https://www.datomic.com/\n[datomic-pull]: https://docs.datomic.com/on-prem/pull.html#pull-grammar\n[eav-model]: https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model\n[rdf]: https://en.wikipedia.org/wiki/Resource_Description_Framework\n[tree]: https://en.wikipedia.org/wiki/Tree_(data_structure)\n[graph]: https://en.wikipedia.org/wiki/Graph_(abstract_data_type)\n[ontology]: https://en.wikipedia.org/wiki/Ontology_(information_science)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelonnewman%2Factiverecord-pull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelonnewman%2Factiverecord-pull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelonnewman%2Factiverecord-pull/lists"}