Ghost/core/server/models
naz bbcc83dadb
Added support for ordering Post API resources by fields coming form posts_meta table (#12226)
refs #11729

- When ordering is done by fields from a relation (like post's `meta_title` that comes form `posts_meta` table), Bookshelf does not include those relations in the original query which caused errors. To support this usecase added a mechanism to detect fields from a relation and load those relations into query. 
- Extended ordering to include table name in ordered field name.  The information about the table name is needed to avoid using `tableName` within pagination plugin and gives path to having other than original table ordering fields (e.g. order by posts_meta table fields)
- Added test case to check ordering on posts_meta fields
- Added support for "eager loading" relations. Allows to extend query builder object with joins to related tables,
which could be used in ordering (possibly in filtering later). Bookshelf does not support ordering/filtering by proprieties coming from relations, that's why this kind of plugin and query expansion is needed
- Added note about lack of support for child relations with same property names.
2020-09-24 13:32:40 +12:00
..
base Added support for ordering Post API resources by fields coming form posts_meta table (#12226) 2020-09-24 13:32:40 +12:00
plugins Added support for ordering Post API resources by fields coming form posts_meta table (#12226) 2020-09-24 13:32:40 +12:00
relations
action.js
api-key.js
author.js
email.js Revert "Store email batch and recipient records when sending newsletters (#12195)" 2020-09-21 17:02:59 +01:00
index.js Revert "Store email batch and recipient records when sending newsletters (#12195)" 2020-09-21 17:02:59 +01:00
integration.js
invite.js
label.js
member-stripe-customer.js Added error handling for failed member imports 2020-08-26 17:11:35 +12:00
member.js 🐛 Fixed incorrect status used for trial subscription query 2020-09-02 13:07:48 +01:00
mobiledoc-revision.js
permission.js
post.js Added support for ordering Post API resources by fields coming form posts_meta table (#12226) 2020-09-24 13:32:40 +12:00
posts-meta.js
role.js
session.js
settings.js
single-use-token.js Added SingleUseToken model (#12215) 2020-09-18 15:05:56 +01:00
stripe-customer-subscription.js Added error handling for failed member imports 2020-08-26 17:11:35 +12:00
tag-public.js
tag.js
user.js
webhook.js