dynarex 1.2.59 → 1.2.60

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6e0737a3027bf55c938277655cca5dbae9ee2e9
4
- data.tar.gz: 587cef6ab3bf142e8d2bdb1129f26ddb9914b4cb
3
+ metadata.gz: e28f8bec7e8969a7fa8532efe1f514d508b52550
4
+ data.tar.gz: 4ccaec06f98229dfeee5f381c18048fc20308aff
5
5
  SHA512:
6
- metadata.gz: e3362cee9108bd89c6a12dbd4d040b2258a7a14feabd356a988e830f096c806cfbdb70094a543696f0c425b27a4bfccbbd94e0b6665145216534ed9c5964f8cb
7
- data.tar.gz: d87aa651c36d7be7f910a451a8a0368feccd6a40f577b4cef98f9c56da2442c80ae6e245d496c3bd1184bdd73002335bc4811433573cdc80c070384a8f302638
6
+ metadata.gz: d0de8f6ac8b3afb93853bf68a643648992f7bf881f2e1b190d6af902aeceff99cd9de62b020471e784cc942ed5104a0452c147bf053e9b9d5cd0993e94082be3
7
+ data.tar.gz: f8fdff4e777f9d9cfd19f018942ec1dd0581c1bcd43fa7c5d32f0e4bfcc305a7632d81081e0e52b713678ed2cde300de078db5828eda7e22b312614904481fad
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -309,6 +309,13 @@ EOF
309
309
  self
310
310
  end
311
311
 
312
+ def default_key=(id)
313
+ @default_key = id.to_sym
314
+ @summary[:default_key] = id
315
+ @fields << id.to_sym
316
+ end
317
+
318
+
312
319
  #Updates a record from an id and a hash containing field name and field value.
313
320
  # dynarex.update 4, name: Jeff, age: 38
314
321
 
@@ -523,6 +530,8 @@ EOF
523
530
 
524
531
  def make_record(raw_params)
525
532
 
533
+ id = (@doc.root.xpath('max(records/*/attribute::id)') || '0').succ unless id
534
+ raw_params.merge!(id: id) if @default_key == :id
526
535
  params = Hash[raw_params.keys.map(&:to_sym).zip(raw_params.values)]
527
536
 
528
537
  fields = capture_fields(params)
@@ -534,7 +543,7 @@ EOF
534
543
  record.add element if record
535
544
  end
536
545
 
537
- id = (@doc.root.xpath('max(records/*/attribute::id)') || '0').succ unless id
546
+
538
547
 
539
548
  attributes = {id: id.to_s, created: Time.now.to_s, last_modified: nil}
540
549
  attributes.each {|k,v| record.add_attribute(k, v)}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.59
4
+ version: 1.2.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  kUea9jZD+xTq1Js9t2BHCz3Ev/sgS7CaijrbQetbNwzasFGHRd30xBEwd4zANQOp
30
30
  i0OBH0e4iIMkv+Q+PYlNRnlpQogsAdTs
31
31
  -----END CERTIFICATE-----
32
- date: 2013-11-23 00:00:00.000000000 Z
32
+ date: 2013-11-26 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rexle
metadata.gz.sig CHANGED
Binary file