0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/test/unit
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
..
adapters Moved core/server/lib/url-utils to core/shared/url-utils (#11856) 2020-05-28 11:57:02 +01:00
api Added Location header to API's POST request responses (#12186) 2020-09-14 22:33:37 +12:00
apps 🐛 Fixed private blogging exposing 404 and robots (#11922) 2020-06-16 11:42:32 +01:00
data Updated the tokens table to have 32 char tokens 2020-09-17 17:33:43 +01:00
helpers Updated tests that were stubbing old ghost_head/ghost_foot settings keys 2020-07-01 17:58:12 +01:00
lib Extracted promise libs and history into @tryghost/promise 2020-08-11 18:44:21 +01:00
models Added support for ordering Post API resources by fields coming form posts_meta table (#12226) 2020-09-24 13:32:40 +12:00
server Fixed settings reinit to only emit changed settings events (#12184) 2020-09-23 14:35:03 +01:00
services Fixed posts_meta relation in test fixtures 2020-09-17 20:46:45 +12:00
shared/config Updated tests locations and added linting of core/shared (#11872) 2020-06-01 22:06:50 +01:00
web Replaced constants file with @tryghost/constants 2020-08-11 12:51:16 +01:00