toolhound-ruby 1.0.33 → 1.0.34

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: a0a074d0a368c009ff282e578f2825a84aa1085d
4
- data.tar.gz: fe00a3c1678033d581688b68514c93a2db0d58f5
3
+ metadata.gz: 5583df86ceff6505bb0bb88fa66ae26a75d0b04b
4
+ data.tar.gz: b8e0a5c4e738fa7e3c683bf575f6d31abd525a3f
5
5
  SHA512:
6
- metadata.gz: e9107c0798c16c6d7a7adb599192a3962cfbdad1c31be02b09825fd4eefe491173b95381d087a127b6dd9ee3938d97a5fbbe6beb11fcaa190e3901918c19ea00
7
- data.tar.gz: 07326504bf65b87b3825a5ebe4af11f765c2b48ef7a678f33d995a72f7b6d2fc69d14fca6a660a9f65b8dcd1cdd04395f8f04a0b456971f221be44cea1921278
6
+ metadata.gz: 5e240492a1c44ed13620d9730a26194e35d0df1e6a9a3cc41100f080d08c84ad3295de062107b50b6391be3e5e3f3a3dd88746a1e0fc80ffbe022decea348635
7
+ data.tar.gz: b6fa8c20567ca6ef935fce0eadc647a82cb638c4a912b553bb77934bc99f7b047e2b03f7a6c8fed07795b5d34b9b342cc72a0c4199a2452c45f70832270e4f19
@@ -372,7 +372,21 @@ module Toolhound
372
372
  when "Hash"
373
373
  attributes.each do |k, v|
374
374
  name = formmatted_column_name(k)
375
- arr << "#{name} = '#{v}'"
375
+
376
+ if v.is_a? Hash
377
+ allow_null = v.delete :null
378
+ value = v.delete :value
379
+ if value.nil? && allow_null == true
380
+ arr << "#{name} = NULL"
381
+ else
382
+ arr << "#{name} = '#{v}'"
383
+ end
384
+
385
+ else
386
+ arr << "#{name} = '#{v}'"
387
+ end
388
+
389
+
376
390
  end
377
391
  when "Array"
378
392
  attributes.each do |v|
@@ -181,13 +181,14 @@ module Toolhound
181
181
 
182
182
  raise ArgumentError.new(:entity_id) unless entity_id
183
183
  raise ArgumentError.new(:inventory_id_id) unless inventory_id_id
184
- raise ArgumentError.new(:job_id) unless job_id
184
+ # raise ArgumentError.new(:job_id) unless job_id
185
185
 
186
- sql = build_sql(from: "job", where: [{"job.int_job_id" => job_id}], limit: 1)
187
- result = query(sql, first: true)
188
-
189
- raise ArgumentError.new(:no_job) if result.length == 0
186
+ if job_id
187
+ sql = build_sql(from: "job", where: [{"job.int_job_id" => job_id}], limit: 1)
188
+ result = query(sql, first: true)
190
189
 
190
+ raise ArgumentError.new(:no_job) if result.length == 0
191
+ end
191
192
 
192
193
  sql = "SELECT * FROM tblRentalCharge WHERE intInventoryIDID = '#{inventory_id_id}' AND intEntityID = '#{entity_id}' "
193
194
  result = query(sql, first: true)
@@ -196,7 +197,7 @@ module Toolhound
196
197
 
197
198
  id = result.first[:rental_charge_id]
198
199
  update({attributes: {
199
- int_job_id: job_id
200
+ int_job_id: {value: job_id, null: true}
200
201
  }, table: "rental_charge", where: [{"rental_charge.int_rental_charge_id" => id}]}, query_opts)
201
202
 
202
203
  end
@@ -1,3 +1,3 @@
1
1
  module Toolhound
2
- VERSION = "1.0.33"
2
+ VERSION = "1.0.34"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toolhound-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.33
4
+ version: 1.0.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Klooth