baseapi 0.3.0 → 0.3.1

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: 882b13dcaa0fe4c292bde76d4f651fec3d39f196
4
- data.tar.gz: 5f8e66928bbb68e3e2973af93f51f55571af1b1b
3
+ metadata.gz: 2d00d49da9c151fd2e10b73220edce2b812df815
4
+ data.tar.gz: e8287d9df7f50bdfc048c6a7870c5d6aa0c48a84
5
5
  SHA512:
6
- metadata.gz: 77ff560cb6c413e88b8a6583ced02478f1bf9d000b927fed215246d7cdb420fea30f0def64ad15a3b7a77a566987a5fff3c3c31deda648ec5b15ed59036bc97f
7
- data.tar.gz: f6b6b0a3f9d5dbd07f98bcb4ba5ec1c48b84b206abbbc372682f230bf3d66b6c19d6d4cf291888f1a34220c01af9389725923907e8b8ab29314c66ddc0305679
6
+ metadata.gz: 4f85f2c12c2631b7fcb86d6c35283085c2fbfeccdabb2fcb0176414d9b62a4fa9dc14be5a1a6d8bdc7bc890695013150286a9e6ab7af98fafd525cb86eceb956
7
+ data.tar.gz: ca9dc9d4e5f34ca9b4767f5b0578b9df983eaef5170dbaa4291bf1cc3ee74fcca8252257b1860001af88ade26074e8bb7a74cd2a0643dfaf3a20e0e9cf7bcdb1
@@ -240,6 +240,13 @@ module ActiveRecordBaseExtension extend ActiveSupport::Concern
240
240
  return value
241
241
  end
242
242
 
243
+ # escape `%`,`_`
244
+ # @param String value
245
+ # @return String
246
+ def escape_sql_value(value)
247
+ value.gsub(/[%_]/, '\\\\\0')
248
+ end
249
+
243
250
  # removal of the `!`,`>`,`<`,`=>`,`=<`,`'`,`"`
244
251
  # @param String value
245
252
  # @return String
@@ -247,6 +254,7 @@ module ActiveRecordBaseExtension extend ActiveSupport::Concern
247
254
  value = escape_not_value(value)
248
255
  value = escape_sign_value(value)
249
256
  value = escape_quotation_value(value)
257
+ value = escape_sql_value(value)
250
258
  return value
251
259
  end
252
260
 
@@ -1,3 +1,3 @@
1
1
  module Baseapi
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baseapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moriyuki Arakawa