dato 0.6.16 → 0.6.17
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/dato/local/items_repo.rb +8 -3
- data/lib/dato/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71d1bdeb92e3e6d4504909f3d0aa3ea63e04a26adf8b1307861049f683957649
|
|
4
|
+
data.tar.gz: 0402e5e79c5b0ac73b4f9156944ccb2f85474dc90b8baec5934937e0a5bdb72e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c38908321fb3f30eabf7af679919beea67c7dc9f8167b2f878c29815f28a9d35179bbfb7fbaafdc10820803418cfd9c23db8a3a7262bc48618e3cd24183a0ed7
|
|
7
|
+
data.tar.gz: c1f5a022f86466cf8411cfd9799e1a459ebf4722bc3b95ef8d23c493f3a9c2c11b386fcb4262a27ef1ede53a5329fa2d251730bac6f17c2607444dd980c6f84b
|
|
@@ -134,11 +134,16 @@ module Dato
|
|
|
134
134
|
item_types.each do |item_type|
|
|
135
135
|
method = item_type_methods[item_type]
|
|
136
136
|
if !item_type.singleton && item_type.sortable
|
|
137
|
-
@collections_by_type[method].
|
|
137
|
+
nil_items, valid_items = @collections_by_type[method].partition do |item|
|
|
138
|
+
item.position.nil?
|
|
139
|
+
end
|
|
140
|
+
@collections_by_type[method] = valid_items.sort_by(&:position) + nil_items
|
|
138
141
|
elsif item_type.ordering_field
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
field = item_type.ordering_field.api_key
|
|
143
|
+
nil_items, valid_items = @collections_by_type[method].partition do |item|
|
|
144
|
+
item[field].nil?
|
|
141
145
|
end
|
|
146
|
+
@collections_by_type[method] = valid_items.sort_by { |item| item[field] } + nil_items
|
|
142
147
|
if item_type.ordering_direction == 'desc'
|
|
143
148
|
@collections_by_type[method].reverse!
|
|
144
149
|
end
|
data/lib/dato/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dato
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefano Verna
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-01-
|
|
11
|
+
date: 2019-01-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|