mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
[PR #115] [MERGED] Import unique objects in the same order as the array of import sources (with fix for potential duplicates) #463
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/JohnEstropia/CoreStore/pull/115
Author: @andriichernenko
Created: 10/23/2016
Status: ✅ Merged
Merged: 11/11/2016
Merged by: @JohnEstropia
Base:
swift3_develop← Head:import-unique-objects-order📝 Commits (3)
4c3bec2fix duplication when using importUniqueObjects with non-unique import sources970957cMerge branch 'duplicate-import-fix' into import-unique-objects-orderd2e78a7add test for the order of unique object import📊 Changes
2 files changed (+152 additions, -36 deletions)
View changed files
📝
CoreStoreTests/ImportTests.swift(+117 -0)📝
Sources/Importing/BaseDataTransaction+Importing.swift(+35 -36)📄 Description
Currently according to the documentation import of unique objects occurs in arbitrary order.
This behavior is different from the import of non-unique objects which might be unexpected. Furthermore, maintaining the order might be useful in some cases.
This pull request modifies importUniqueObjects(...) method to ensure that the order of import sources, order of import method calls and the order of imported objects in the returned array are the same.
This pull request is #109 combined with #111 which fixes the problem when duplicate objects are created if the array of input sources contains multiple items with the same ID.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.