toolhound-ruby 1.0.13 → 1.0.14

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
  SHA1:
3
- metadata.gz: 2066d770abb531ef783f2453f8df79e09f4cf3f8
4
- data.tar.gz: e344e681caf7bb9e4ffd3255e89261ab57e4ca5b
3
+ metadata.gz: 5d805f7cd2610f4eb8ebfbe333ee7a1c2f1bbb7c
4
+ data.tar.gz: 41e60e242c01ba995bef8ad7a807fadc33942070
5
5
  SHA512:
6
- metadata.gz: e02ea1af8bda11dd2e7ebbc500a5e2329b3bf3fe76c6cdbf17a4629488c86a2117c8753da74722810a248cef0b0eb4b3e77beb9aaaf5a768a2c655703500e364
7
- data.tar.gz: 3f7277d8f6a8935a7b11f527b3310a6e0b93a2859eca1a6d07a1dae2e52f0f85d8c6d44f4483e1d4389c9afe4c593b812632226a06a79b154fb9ab633e5b51fe
6
+ metadata.gz: 6766bab4a1f3640263fd06224dec835c83cd1bcc4f6921af22d11f35e03548d306087e94031fad46d5f8fcb144cbb68fd8838768e2a19bb502bd2c2505f7847b
7
+ data.tar.gz: 114688fb921a19ff062e15f4d0a3db0a0f762cd66ada32df401919d3202ec76f4810bf2b5e01f3476f84bf6d023bd1be9e45fa4f9632c33c6ab0ea42def391b7
@@ -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")
@@ -1,3 +1,3 @@
1
1
  module Toolhound
2
- VERSION = "1.0.13"
2
+ VERSION = "1.0.14"
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.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Klooth