{"id":14955941,"url":"https://github.com/jun0kada/activerecord-preload_block","last_synced_at":"2026-02-10T19:05:19.900Z","repository":{"id":62552876,"uuid":"173301355","full_name":"Jun0kada/activerecord-preload_block","owner":"Jun0kada","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-05T09:31:07.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-27T09:40:51.262Z","etag":null,"topics":["activerecord","rails","ruby"],"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/Jun0kada.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2019-03-01T12:51:59.000Z","updated_at":"2019-03-12T03:16:16.000Z","dependencies_parsed_at":"2022-11-03T04:15:17.911Z","dependency_job_id":null,"html_url":"https://github.com/Jun0kada/activerecord-preload_block","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jun0kada/activerecord-preload_block","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jun0kada%2Factiverecord-preload_block","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jun0kada%2Factiverecord-preload_block/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jun0kada%2Factiverecord-preload_block/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jun0kada%2Factiverecord-preload_block/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jun0kada","download_url":"https://codeload.github.com/Jun0kada/activerecord-preload_block/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jun0kada%2Factiverecord-preload_block/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267717920,"owners_count":24133443,"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-07-29T02:00:12.549Z","response_time":2574,"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","rails","ruby"],"created_at":"2024-09-24T13:12:03.387Z","updated_at":"2025-11-17T03:17:11.016Z","avatar_url":"https://github.com/Jun0kada.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Activerecord::PreloadBlock\n[![Build Status](https://travis-ci.org/Jun0kada/activerecord-preload_block.svg?branch=master)](https://travis-ci.org/Jun0kada/activerecord-preload_block)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'activerecord-preload_block'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install activerecord-preload_block\n\n## Usage\n\n```ruby\n# eq: User.all.preload(:comments, :posts)\nUser.all.preload do |records|\n  preload records, :comments\n  preload records, :posts\nend\n\n# filter preload owner\nUser.all.preload do |records|\n  preload records.select(\u0026:hoge?), :comments\nend\n\n# filter preload associations records\nUser.all.preload do |records|\n  preload records, :comments, Comment.where(hoge: 'foo')\nend\n\n# with arguments\nUser.all.preload(:posts) do |records|\n  preload records, :comments\nend\n```\n\n[gem 'activerecord-records_on_load'](https://github.com/Jun0kada/activerecord-records_on_load)\nis also helpful for customizing AR records loaded hook\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activerecord-preload_block. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\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 Activerecord::PreloadBlock project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/activerecord-preload_block/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjun0kada%2Factiverecord-preload_block","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjun0kada%2Factiverecord-preload_block","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjun0kada%2Factiverecord-preload_block/lists"}