pg_search
https://github.com/casecommons/pg_search
Ruby
pg_search builds ActiveRecord named scopes that take advantage of PostgreSQL’s full text search
MergeRequest.in_projects
Returns all the merge requests from an ActiveRecord:Relation. This method uses a UNION as it usually operates on the result of ProjectsFinder#execute. PostgreSQL in particular doesn't always like queries using multiple sub-queries especially when combined with an OR statement. UNIONs on the other hand perform much better in these cases. relation - An ActiveRecord::Relation that returns a list of Projects. Returns an ActiveRecord::Relation.
Edit
git clone [email protected]:casecommons/pg_search.git
cd pg_search
open
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-MergeRequest-in_projects-for-pr
# Commit to gitgit add git commit -m "better docs for MergeRequest.in_projects"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-MergeRequest-in_projects-for-pr
hub pull-request
# Celebrate!