{"id":28828787,"url":"https://github.com/mojotech/batchelor","last_synced_at":"2026-01-31T22:34:33.107Z","repository":{"id":5427813,"uuid":"6619871","full_name":"mojotech/batchelor","owner":"mojotech","description":"Override find_in_batches and find_each in ActiveRecord decendant classes that do not have an integer primary key as these will not work when using PostgreSQL.","archived":false,"fork":false,"pushed_at":"2012-11-09T21:24:41.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-10-13T06:48:49.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/mojotech.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":"2012-11-09T20:48:48.000Z","updated_at":"2013-11-20T03:04:44.000Z","dependencies_parsed_at":"2022-07-06T17:30:58.151Z","dependency_job_id":null,"html_url":"https://github.com/mojotech/batchelor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mojotech/batchelor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fbatchelor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fbatchelor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fbatchelor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fbatchelor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mojotech","download_url":"https://codeload.github.com/mojotech/batchelor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fbatchelor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28958342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T22:20:19.638Z","status":"ssl_error","status_checked_at":"2026-01-31T22:18:07.061Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-06-19T05:10:15.715Z","updated_at":"2026-01-31T22:34:33.102Z","avatar_url":"https://github.com/mojotech.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Batchelor\n=========\n\nOverride find\\_in\\_batches and find\\_each in ActiveRecord decendant classes that do not have an integer primary key as these will not work when using PostgreSQL.\n\nUsage\n=====\n\nVery simply run `gem install batchelor` or include `gem 'batchelor'` in your app's `Gemfile`. Then if you have a class that has a non-integer primary key, just add `extend Batchelor` to the class definition and you can use `find_in_batches` and `find_each` by extension.\n\nCaveats\n=======\n\nI have been told that the reason this is **not** in Rails is because `find_in_batches` and `find_each` are expected to process any new records that are created while the block is running. This will happen for incrementing integer primary keys but is not guaranteed for strings. This is just to give you a convenient and query efficient way to iterate over all records of a model with a non integer primary key.\n\nSqlite (and maybe other databases) will actually let you use the `\u003e=` operator on strings so this gem isn't necessary when using it.\n\nCredits\n==========\n\n[![MojoTech](http://www.mojotech.com/press/logo.png)](http://www.mojotech.com)\n\nLicense\n==========\n\nBatchelor is Copyright © 2012 MojoTech, LLC. and is released under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojotech%2Fbatchelor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmojotech%2Fbatchelor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojotech%2Fbatchelor/lists"}