toolhound-ruby 1.0.13 → 1.0.14
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/toolhound-ruby/base.rb +9 -1
- data/lib/toolhound-ruby/transaction.rb +1 -1
- 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: 5d805f7cd2610f4eb8ebfbe333ee7a1c2f1bbb7c
|
4
|
+
data.tar.gz: 41e60e242c01ba995bef8ad7a807fadc33942070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6766bab4a1f3640263fd06224dec835c83cd1bcc4f6921af22d11f35e03548d306087e94031fad46d5f8fcb144cbb68fd8838768e2a19bb502bd2c2505f7847b
|
7
|
+
data.tar.gz: 114688fb921a19ff062e15f4d0a3db0a0f762cd66ada32df401919d3202ec76f4810bf2b5e01f3476f84bf6d023bd1be9e45fa4f9632c33c6ab0ea42def391b7
|
data/lib/toolhound-ruby/base.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
module Toolhound
|
2
2
|
|
3
3
|
class Base
|
4
|
-
DB_TYPE_REGEX = /^(int|dec|var|bol|dte|bin)
|
4
|
+
DB_TYPE_REGEX = /^(int|dec|var|bol|dte|bin)/.freeze
|
5
|
+
|
6
|
+
DATE_TIME_FORMAT = "%Y-%m-%d %H:%M:%S".freeze
|
5
7
|
|
6
8
|
include Toolhound::Util
|
7
9
|
attr_accessor :connection
|
@@ -355,6 +357,12 @@ module Toolhound
|
|
355
357
|
"'#{value}'"
|
356
358
|
end
|
357
359
|
|
360
|
+
def parse_time(date)
|
361
|
+
date = date.utc if date.respond_to?(:utc)
|
362
|
+
|
363
|
+
date.strftime(DATE_TIME_FORMAT)
|
364
|
+
end
|
365
|
+
|
358
366
|
def transform_procedure_key(key)
|
359
367
|
key = key.to_s
|
360
368
|
key = camelize(key, true)
|
@@ -84,7 +84,7 @@ module Toolhound
|
|
84
84
|
wheres << {"transaction_type.bol_return" => 'true'}
|
85
85
|
|
86
86
|
wheres << {"transaction.int_entity_id" => entity_id} if entity_id
|
87
|
-
wheres << "tblTransaction.dteTransactionDate BETWEEN '#{from_date}' AND '#{to_date}'" if from_date && to_date
|
87
|
+
wheres << "tblTransaction.dteTransactionDate BETWEEN '#{parse_time(from_date)}' AND '#{parse_time(to_date)}'" if from_date && to_date
|
88
88
|
wheres << "(tblReturnStatus.bolCreateWO = 1 OR tblReturnStatus.bolRetire = 1)" if damaged_only == true
|
89
89
|
|
90
90
|
build_and_query(joins: joins, selects: selects, where: wheres, from: 'tblTransactionDetail', order: "tblEntityLocationText.varLocationName")
|