Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix schemas #12

Open
jteplitz opened this issue Sep 4, 2012 · 0 comments
Open

Fix schemas #12

jteplitz opened this issue Sep 4, 2012 · 0 comments
Assignees
Labels
Milestone

Comments

@jteplitz
Copy link
Member

jteplitz commented Sep 4, 2012

If we start encapsulating all our code, things stop being global. Which is good. But the problem is we've been bad. And we've been keeping our schemas in global vars. Which is very bad. So let's make our schema's file export its schemas and then we'll require it in each file that uses it. Or better yet lets put it in middleware. So our routes file will include a boolean for each route that says if it needs schemas or not, and then if it does we'll load the schemas into req._schemas. This way we know exactly which routes access the database and we only load the schemas file once.

@ghost ghost assigned jteplitz Sep 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant