Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some Model and Collection lodash based methods #2005

Merged
merged 3 commits into from Aug 11, 2019

Conversation

@ricardograca
Copy link
Member

commented Aug 11, 2019

Introduction

This removes some Model and Collection methods that are just a pass-through to the same named lodash methods.

Motivation

These methods are not very useful or they duplicate functionality, so they should be removed. Some of them are so strange that no one is really sure why they're still around or if they even make sense, like Model#invert.

In the case of Collection#first and Collection#last, they are useful as shortcuts for some often needed model, but there is no need to use lodash for that functionality.

Closes #2004.

Proposed solution

A lot of these methods are simply removed. See the linked issue for the complete list. A migration guide is provided to help people that might be using these methods.

There are also two methods that are re-implemented using functionality that is already available in Bookshelf, without the need to involve lodash: Collection#first and Collection#last. There is no difference in terms of functionality in this case.

Current PR Issues

Breaks backwards-compatibility.

@ricardograca ricardograca added the change label Aug 11, 2019
@ricardograca ricardograca merged commit d6f9eb2 into master Aug 11, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@ricardograca ricardograca deleted the rg-remove-lodash-shortcuts branch Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.