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

Fix missing attributes in some events #1934

Merged
merged 4 commits into from
Dec 25, 2018
Merged

Fix missing attributes in some events #1934

merged 4 commits into from
Dec 25, 2018

Conversation

ricardograca
Copy link
Member

@ricardograca ricardograca commented Dec 25, 2018

Introduction

Fixes an issue that prevented all of the attributes that are going to be inserted or updated to be present in the second argument to the event listener of both the creating and updating events.

Motivation

Fixes #1433.

Proposed solution

This simply moves the logic that selects which attributes are going to be saved a bit further up and uses that as the argument to the event handlers, instead of always passing the attrs object.

Also adds another test to verify that save() will use both the attributes passed to it as well as any others that were already set on the model.

@ricardograca ricardograca changed the title Rg event attrs Fix missing attributes in some events Dec 25, 2018
@ricardograca ricardograca merged commit 716f0b6 into master Dec 25, 2018
@ricardograca ricardograca deleted the rg-event-attrs branch December 25, 2018 20:24
6utt3rfly added a commit to betastreet/bookshelf-modelbase-plus that referenced this pull request Apr 29, 2019
6utt3rfly added a commit to betastreet/bookshelf-modelbase-plus that referenced this pull request Apr 29, 2019
6utt3rfly added a commit to betastreet/bookshelf-prefixed-ordered-uuid that referenced this pull request Apr 29, 2019
@ricardograca
Copy link
Member Author

This was released in version 0.15.0.

This pull request was closed.
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.

attrs in 'creating' event handler only contains 'created_at' and 'updated_at'
1 participant