Skip to content

Conversation

@ricardograca
Copy link
Member

@ricardograca ricardograca commented Jul 27, 2019

Introduction

Move the registry plugin to core Bookshelf.

Motivation

This is a useful plugin and is the best way to ensure there are no circular dependencies issues when models are located in different files.

Fixes #1557.

Proposed solution

Functionality is moved to the bookshelf.js file. Note that registered models and collections are now stored in the bookshelf.registry.models and bookshelf.registry.collections respectively. This means the change is not backwards compatible but it's not expected that users were accessing bookshelf._models and bookshelf._collections directly anyway.

A lot of the code was modernized.

- This replaces the previous bookshelf.Model.extend() method usage since 
it's preferable as it avoids circular dependencies.
@ricardograca ricardograca merged commit 189b828 into master Jul 28, 2019
@ricardograca ricardograca deleted the rg-core-registry branch July 28, 2019 15:07
@ricardograca ricardograca mentioned this pull request Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Registry: multiple databases with same schema

2 participants