Since the very beginning, people seems to intuitively think includes is gonna include all linked resources, even if that link is paginated on it's own. Unfortunately that is/was never the case. In fact includes was only fetching and including the first page of the linked collection, while includes_all was making sure to paginate that collection and really include all of them.
This miss-understanding, or lack of - what it seems - to be an none-intuitive method interface in the first place usually leads to problems down the road once you hit edge-case in you application where records do have more then X linked items. Like places with hundreds of contracts, or places with hundreds of accounts etc.
This PR changes the defaults and makes includes include all linked resources even if it is paginated, and includes_first_page is explicitly only gonna include the first page of the linked collection.
Addresses https://github.com/local-ch/lhs/issues/304
Since the very beginning, people seems to intuitively think
includes
is gonna include all linked resources, even if that link is paginated on it's own. Unfortunately that is/was never the case. In factincludes
was only fetching and including the first page of the linked collection, whileincludes_all
was making sure to paginate that collection and really include all of them.This miss-understanding, or lack of - what it seems - to be an none-intuitive method interface in the first place usually leads to problems down the road once you hit edge-case in you application where records do have more then X linked items. Like places with hundreds of contracts, or places with hundreds of accounts etc.
This PR changes the defaults and makes
includes
include all linked resources even if it is paginated, andincludes_first_page
is explicitly only gonna include the first page of the linked collection.Migration Path
includes
withincludes_first_page
includes_all
withincludes
Needs to be in this order 😉