standard-file 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/standard_file/sync_manager.rb +8 -3
- data/lib/standard_file/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ab8f64216e606826f8cf9724b89725e0e36fa77
|
4
|
+
data.tar.gz: e5fcc42d7de62ebbdc7baf0e30a0773cda1eb2d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb025676ebfbe79137614e2c799a8b80a09542450dc11327fd2ca31a757998e6a6a7fcacb143e1f083ac7a502c3193552bb9968eb56be88e48303a7111b228e2
|
7
|
+
data.tar.gz: f20eced00dd47a3a496e8f0ce932d996a85c8f1864de2aab3e9c12631a2eb572fcb84861f2b05d09d58d825213ad4ea0088d7ca867093e47a423c9ef6d6fb778
|
@@ -26,8 +26,6 @@ module StandardFile
|
|
26
26
|
saved_items, unsaved = _sync_save(item_hashes)
|
27
27
|
if saved_items.length > 0
|
28
28
|
last_updated = saved_items.sort_by{|m| m.updated_at}.last.updated_at
|
29
|
-
# add 1 microsecond to avoid returning same object in subsequent sync
|
30
|
-
last_updated = (last_updated.to_time + 1/100000.0).to_datetime.utc
|
31
29
|
end
|
32
30
|
|
33
31
|
# manage conflicts
|
@@ -46,11 +44,18 @@ module StandardFile
|
|
46
44
|
dup = conflicted.dup
|
47
45
|
dup.user = conflicted.user
|
48
46
|
dup.save
|
49
|
-
|
47
|
+
dup_json = dup.as_json({})
|
48
|
+
dup_json[:conflict_of] = conflicted.uuid
|
49
|
+
retrieved_items.push(dup_json)
|
50
|
+
|
51
|
+
last_updated = dup.updated_at
|
50
52
|
end
|
51
53
|
retrieved_items.delete(conflicted)
|
52
54
|
end
|
53
55
|
|
56
|
+
# add 1 microsecond to avoid returning same object in subsequent sync
|
57
|
+
last_updated = (last_updated.to_time + 1/100000.0).to_datetime.utc
|
58
|
+
|
54
59
|
sync_token = sync_token_from_datetime(last_updated)
|
55
60
|
return {
|
56
61
|
:retrieved_items => retrieved_items,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standard-file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Standard File
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|