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

Use lodash isEqual to check if a model is dirty #384

Merged
merged 1 commit into from Sep 13, 2018
Merged

Use lodash isEqual to check if a model is dirty #384

merged 1 commit into from Sep 13, 2018

Conversation

benjamincanac
Copy link
Contributor

Proposed changes

This fix uses _.isEqual instead of !== in the dirty getter to compare $attributes and $originalAttributes.

This allows comparaison with json objects.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

@benjamincanac benjamincanac changed the title fix(model): use lodash isEqual to check if a model is dirty Use lodash isEqual to check if a model is dirty Sep 12, 2018
@thetutlage
Copy link
Member

Yes, this makes sense

@thetutlage thetutlage merged commit 88fe6ea into adonisjs:develop Sep 13, 2018
@thetutlage
Copy link
Member

Thanks 😄

@benjamincanac benjamincanac deleted the fix/equals-dirty-model branch September 26, 2018 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants