0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/models
Katharina Irrgang dfd4afea19 Add bookshelf-relations (#9252)
no issue

- added https://github.com/TryGhost/bookshelf-relations as dependency
- remove existing tag handling

--- 

* Important: Ensure we trigger parent initialize function

- otherwise the plugin is unable to listen on model events
- important: event order for listeners is Ghost -> Plugin
- Ghost should be able to listen on the events as first instance
- e.g. be able to modify/validate relationships

* Fix tag validation

- we detect lower/update case slugs for tags manually
- this can't be taken over from the plugin obviously
- ensure we update the target model e.g. this.set('tags', ...)

* override base fn: `permittedAttributes`

- ensure we call the base
- put relations on top
- each relation is allowed to be passed
- the plugin will auto-unset any relations to it does not reach the database

* Ensure we run add/edit/delete within a transaction

- updating nested relationships requires sql queries
- all sql statements have to run in a single transaction to ensure we rollback everything if an error occurs
- use es6
2017-11-21 13:28:05 +00:00
..
base Add bookshelf-relations (#9252) 2017-11-21 13:28:05 +00:00
plugins 🐛 Fixed pagination error (#9243) 2017-11-14 12:47:58 +00:00
accesstoken.js 🎨 register events in base model (#7560) 2016-10-14 13:37:01 +01:00
app-field.js
app-setting.js
app.js Switch to Eslint (#9197) 2017-11-01 13:44:54 +00:00
client-trusted-domain.js
client.js 🎨 😎 config env usages (#7929) 2017-02-03 18:25:39 +00:00
index.js 🎨 Separate invites from user 2016-09-26 11:08:43 +02:00
invite.js 🎨 invites roles table into a field on the invites table (#7705) 2016-11-16 09:33:44 +00:00
permission.js
post.js Add bookshelf-relations (#9252) 2017-11-21 13:28:05 +00:00
refreshtoken.js
role.js Support for attribute-based permissions (#9025) 2017-09-26 18:06:14 +02:00
settings.js Refactored to save settings only if value changes (#9194) 2017-10-31 15:47:30 +00:00
subscriber.js Support for attribute-based permissions (#9025) 2017-09-26 18:06:14 +02:00
tag.js Switch to Eslint (#9197) 2017-11-01 13:44:54 +00:00
user.js Changed logic for importPersistUser option (#9203) 2017-11-07 09:09:57 +01:00