pg_search
https://github.com/casecommons/pg_search
Ruby
pg_search builds ActiveRecord named scopes that take advantage of PostgreSQL’s full text search
RepositoryCheck::BatchWorker#project_ids
Project.find_each does not support WHERE clauses and Project.find_in_batches does not support ordering. So we just build an array of ID's. This is OK because we do it only once an hour, because getting ID's from Postgres is not terribly slow, and because no user has to sit and wait for this query to finish.
Edit
git clone [email protected]:casecommons/pg_search.git
cd pg_search
open
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-RepositoryCheck--BatchWorker-project_ids-for-pr
# Commit to gitgit add git commit -m "better docs for RepositoryCheck::BatchWorker#project_ids"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-RepositoryCheck--BatchWorker-project_ids-for-pr
hub pull-request
# Celebrate!