effective_qb_online 0.3.1 → 0.3.2

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
  SHA256:
3
- metadata.gz: 708e4ea3c01bb95426e9510b340fbc6502a95641fa632a410a23c9cf055b5eb0
4
- data.tar.gz: c2c281898e1dd857b878f04a3b0e91c714984cb48a34a3c999e2bd5cdd8d3fad
3
+ metadata.gz: c2ddde7401c7aaaa2461796d66a640bf9ec38ab749ec858f8ef5e5a403885fb6
4
+ data.tar.gz: bf8a3d9c0ca0ea906d32e841aede9b8e05fd9b04675f54fb84e7472fa2a1b533
5
5
  SHA512:
6
- metadata.gz: c4c1e3b37d577e13e520c82851992d5830b526d00265c48533cfe3f31e08209666206621b12eed0ceae5b2fbb0d7c2d3224bc8b5503977ac908ae8051f6f5945
7
- data.tar.gz: e649a27a72668157f8b7298f70ed6729ccd42007b4e13ccaebea40c2a4a3d172ce2f31158cdb371aa7bc236b51160777837dc8e72ad5f19b95faf444f13ebb61
6
+ metadata.gz: ceeb4d37581de7b426ef5fde3f43ef4d2efcb50e75b2b715cfd9ddf91aa827d07fcf75a1f693c5fb9f89c92c7be03364596d0ac56918d13fff2618f38e723e4e
7
+ data.tar.gz: b161ebde1d8c67e80e95d45a689c7327594920ac4e4b75ccb9e1b581c01abec425609363dc4b1f55d96a5435976812e596a84dab6c58a7c9035c6ae790c1020e
@@ -110,7 +110,7 @@ module Effective
110
110
 
111
111
  # Find by given name and family name
112
112
  customer ||= if user.respond_to?(:first_name) && user.respond_to?(:last_name)
113
- service.query("SELECT * FROM Customer WHERE GivenName LIKE '#{scrub(user.first_name)}' AND FamilyName LIKE '#{scrub(user.last_name)}'")&.first
113
+ service.query("SELECT * FROM Customer WHERE GivenName LIKE '#{scrub(user.first_name, sql: true)}' AND FamilyName LIKE '#{scrub(user.last_name, sql: true)}'")&.first
114
114
  end
115
115
 
116
116
  # Find by display name
@@ -217,9 +217,11 @@ module Effective
217
217
  end
218
218
  end
219
219
 
220
- def scrub(value)
220
+ def scrub(value, sql: false)
221
221
  return nil unless value.present?
222
- value.gsub(':', '')
222
+ value = value.gsub(':', '')
223
+ value = value.gsub("'", "\\'") if sql
224
+ value
223
225
  end
224
226
 
225
227
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveQbOnline
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_qb_online
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-09 00:00:00.000000000 Z
11
+ date: 2023-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails