dxlite 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ceb35ccf99574494fddc04bcff1ca0da8f3e9105ff96663c4127e001e6c0d0f4
4
- data.tar.gz: cb7d10780d5fe0930c82ef96918662a9bb0cfa7b52b340987e633e4d5a52c531
3
+ metadata.gz: 6f01e71eb6492777d8d892c3ba33c662de229a26adb5141aa946355a7202c0a0
4
+ data.tar.gz: f84b22c52e8decf1a0cf870e322463d1de725523ed02acf0d545c52ea5a167c2
5
5
  SHA512:
6
- metadata.gz: 6cc80cf0885f8973443fd2301cbaf9a1f85eb65c47600feb3cf33097ccdc2953a7f0dc9dfd670b80f38255088d2a643bcff2bb80e55b8e179bb20fafc89e5214
7
- data.tar.gz: f75f94e5af4dbdc3277f698915661d6028b9f04cda8c17f8626767586b69139febfd30cdcb3e9fc40528c297b6125a7dea2e81b0385204852fe174748b9c9d23
6
+ metadata.gz: ee41e2b9acd447bb03536592dce815cbd7c803805bcefd9676392fde951446aab689748614031d1e5405d263f5429b91767cc72f1b39924b728b141f4bcd2fcb
7
+ data.tar.gz: 51d67cc2d50bcd0111ef60571cf2421d2854245f3408e287f375502aaf49ef824d6ec2bc34e0c3b61612b47206ea807965780b1fc3c0a42ea6da8241c22f4442
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/dxlite.rb CHANGED
@@ -94,8 +94,16 @@ class DxLite
94
94
  if key then
95
95
 
96
96
  r = records.find {|x| x[:body][key.to_sym] == rawh[key.to_sym]}
97
+
97
98
  if r then
99
+
100
+ # if the client is using create() instead of update() to update a
101
+ # record then update the record
102
+ #
103
+ r[:body].merge!(rawh)
98
104
  r[:last_modified] = Time.now.to_s
105
+ save() if @autosave
106
+
99
107
  return false
100
108
  end
101
109
 
@@ -225,13 +233,24 @@ class DxLite
225
233
  record_name = schema()[/(?<=\/)[^\(]+/]
226
234
 
227
235
  records = @records.map {|h| {record_name.to_sym => h} }
228
- records.reverse! if @summary[:order] == 'descending'
236
+
237
+ a = if @summary[:order] == 'descending' then
238
+
239
+ records.sort_by do |x|
240
+ x[:last_modified] || x[:created]
241
+ end.reverse
242
+
243
+ else
244
+
245
+ records
246
+
247
+ end
229
248
 
230
249
  h = {
231
250
  root_name.to_sym =>
232
251
  {
233
252
  summary: @summary,
234
- records: records
253
+ records: a
235
254
  }
236
255
  }
237
256
 
@@ -285,6 +304,7 @@ class DxLite
285
304
  if r then
286
305
 
287
306
  r[:body].merge!(obj)
307
+ r[:last_modified] = Time.now
288
308
  save() if @autosave
289
309
 
290
310
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dxlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  9pK+pqislEMFrWscGeMsc6YMS7ALxEujTuwTWyxmWAXnYft4ff2O1Zh2sPmdOlgf
36
36
  camg7d8q+VZZzAtz0cFc4pip
37
37
  -----END CERTIFICATE-----
38
- date: 2022-03-19 00:00:00.000000000 Z
38
+ date: 2022-03-21 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: recordx
metadata.gz.sig CHANGED
Binary file