Skip to content

Conversation

@ricardograca
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove useless Model and Collection methods

2 participants