standard-file 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/standard_file/sync_manager.rb +7 -2
- 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: 7507a20e41218ab29adb02614a3d56c8093b920e
|
4
|
+
data.tar.gz: d03b8b5fe61838f446b550bc289a4ba34226903a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f4b70e3fee538bf9709b2328f2832bed09d081042e779cf6762dc56453022a136797353c723315c910723f29d28ac4d417015c5845e31ed3d0b0d4fa03004ed
|
7
|
+
data.tar.gz: c3a9908c6eae5dc5ea533482a6e25daa3a5d52ce3e635e2a4bcc5b6e9e19e0510028e34bc7e97fdbead59b3b044f278d307ec529632e186c8c8325d697429ba8
|
@@ -21,8 +21,9 @@ module StandardFile
|
|
21
21
|
in_sync_token = options[:sync_token]
|
22
22
|
in_cursor_token = options[:cursor_token]
|
23
23
|
limit = options[:limit]
|
24
|
+
content_type = options[:content_type] # optional, only return items of these type if present
|
24
25
|
|
25
|
-
retrieved_items, cursor_token = _sync_get(in_sync_token, in_cursor_token, limit).to_a
|
26
|
+
retrieved_items, cursor_token = _sync_get(in_sync_token, in_cursor_token, limit, content_type).to_a
|
26
27
|
last_updated = DateTime.now
|
27
28
|
saved_items, unsaved_items = _sync_save(item_hashes, request)
|
28
29
|
if saved_items.length > 0
|
@@ -140,7 +141,7 @@ module StandardFile
|
|
140
141
|
return saved_items, unsaved
|
141
142
|
end
|
142
143
|
|
143
|
-
def _sync_get(sync_token, input_cursor_token, limit)
|
144
|
+
def _sync_get(sync_token, input_cursor_token, limit, content_type)
|
144
145
|
cursor_token = nil
|
145
146
|
if limit == nil
|
146
147
|
limit = 100000
|
@@ -162,6 +163,10 @@ module StandardFile
|
|
162
163
|
items = @user.items.order(:updated_at).where(:deleted => false)
|
163
164
|
end
|
164
165
|
|
166
|
+
if content_type
|
167
|
+
items = items.where(:content_type => content_type)
|
168
|
+
end
|
169
|
+
|
165
170
|
items = items.sort_by{|m| m.updated_at}
|
166
171
|
|
167
172
|
if items.count > limit
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Standard File
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|