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 #reload and mark model as persisted after reloading #567

Merged

Conversation

andrykonchin
Copy link
Member

Fix the following scenario:

  • there is a persisted item
  • we initialize a new model with the same primary key
  • try to save it and fail because such item already exists
  • try to reload it

Expected result

  • reloaded model should be marked as persisted and #new_record? should return false.

Closes #564

@andrykonchin andrykonchin force-pushed the issue-564-fix-set-new-record-false-after-reloading branch from e228a86 to 340bb19 Compare July 9, 2022 10:38
@andrykonchin andrykonchin merged commit b1f8322 into master Jul 9, 2022
@andrykonchin andrykonchin deleted the issue-564-fix-set-new-record-false-after-reloading branch July 9, 2022 11:13
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.

reload doesn't reset new_record
1 participant