toolhound-ruby 1.0.33 → 1.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toolhound-ruby/base.rb +15 -1
- data/lib/toolhound-ruby/inventory_item.rb +7 -6
- data/lib/toolhound-ruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5583df86ceff6505bb0bb88fa66ae26a75d0b04b
|
4
|
+
data.tar.gz: b8e0a5c4e738fa7e3c683bf575f6d31abd525a3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e240492a1c44ed13620d9730a26194e35d0df1e6a9a3cc41100f080d08c84ad3295de062107b50b6391be3e5e3f3a3dd88746a1e0fc80ffbe022decea348635
|
7
|
+
data.tar.gz: b6fa8c20567ca6ef935fce0eadc647a82cb638c4a912b553bb77934bc99f7b047e2b03f7a6c8fed07795b5d34b9b342cc72a0c4199a2452c45f70832270e4f19
|
data/lib/toolhound-ruby/base.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
187
|
-
|
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
|