Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upContradictory documentation regarding fetch {require: true} #2055
Labels
Projects
Comments
|
You are correct. There is a small inconsistency, but notice that in the parameters list at least it mentions |
|
Oooops, you are right, I missed that one, sorry. |
|
Reopening since I agree that the description text could be updated to remove any ambiguity. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Introduction
It seems the API-description for "fetch" does not match the actual behaviour and the changelog information.
Issue Description
In the API description for "fetch"
https://bookshelfjs.org/api.html#Collection-instance-fetch
it reads
To me, this means, that that {require: true} would be explicitly needed to be set in order to trigger the empty collection error which in return would mean that {require: false} would be the default.
However the current behaviour as described in
https://github.com/bookshelf/bookshelf/blob/master/CHANGELOG.md for version 1.0.0
#2006
says that default would be (and actually is) {require: false}
Therefore I think the API documentation should reflect that by saying:
"If you do not wish to trigger an error if the fetched collection is empty, pass {require: false} as one of the options to the fetch call."