activerecord_bulkoperation 0.0.6 → 0.0.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fd7b2c2456f8bf5d1522669b3169a97609ede57
|
4
|
+
data.tar.gz: 650d94dc039ec2a30509d64f59e98c44cafd0830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7a552c53ab19e865cd000b3182c86b628f73e391e2c512202aaea2d861309ecdcb07576728c78202a757739ace52e15a8f3ae18f91af66d7fbbf99a4133b557
|
7
|
+
data.tar.gz: b49271ed11969fb47cb60c614df7d7fa5fde3b93e5313b356a4f337ff891e35e11720d51575bd51fcf95bfdda6478f54c2e5b92002e21a9a42adfef8bce79744
|
@@ -172,7 +172,7 @@ module ActiveRecord
|
|
172
172
|
|
173
173
|
def bind_column(cursor, index, type, column)
|
174
174
|
if type == :string
|
175
|
-
cursor.bind_param_array(":#{index}", column, String)
|
175
|
+
cursor.bind_param_array(":#{index}", column, String, get_max_string_length(column))
|
176
176
|
|
177
177
|
elsif type == :integer
|
178
178
|
cursor.bind_param_array(":#{index}", column, Fixnum)
|
@@ -189,6 +189,19 @@ module ActiveRecord
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
|
+
def get_max_string_length(column)
|
193
|
+
return nil if column.nil?
|
194
|
+
|
195
|
+
max_length = 0
|
196
|
+
|
197
|
+
column.each do |value|
|
198
|
+
next if value.nil?
|
199
|
+
max_length = value.length if value.length > max_length
|
200
|
+
end
|
201
|
+
|
202
|
+
return max_length > 0 ? max_length : nil
|
203
|
+
end
|
204
|
+
|
192
205
|
def get_date_type(value)
|
193
206
|
return Date if value.nil?
|
194
207
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord_bulkoperation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OSP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|