alchemy_cms
https://github.com/magiclabs/alchemy_cms
Ruby
AlchemyCMS is a powerful, flexible and user centric Rails 5 CMS. 🧙🏻♂️
User#contributed_projects
Returns the projects a user contributed to in the last year.
This method relies on a subquery as this performs significantly better
compared to a JOIN when coupled with, for example,
`Project.visible_to_user`. That is, consider the following code:
some_user.contributed_projects.visible_to_user(other_user)
If this method were to use a JOIN the resulting query would take roughly 200
ms on a database with a similar size to GitLab.com's database. On the other
hand, using a subquery means we can get the exact same data in about 40 ms.Edit
git clone [email protected]:magiclabs/alchemy_cms.git
cd alchemy_cms
open
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-User-contributed_projects-for-pr
# Commit to gitgit add git commit -m "better docs for User#contributed_projects"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-User-contributed_projects-for-pr
hub pull-request
# Celebrate!