Project feature checks should not trigger database queries
Whenever you initialize a Project it calls Project#setup_project_feature. This in turn calls Project#project_feature which executes a database query. This is executed every time we initialize a Project, anywhere.
To remove the query we should do two things:
- Add a column to
projectscalledhas_project_featurewith the typeboolean - In
setup_project_featurewe check if this column is set totrue, if not we create the row and set the column totrue. We do not perform any checks when this is set totrue
This will remove the need for any extra queries after the first time a project is initialized.