activerecord-turntable 2.3.1 → 2.3.2
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: c476ca06fe32521466081db5b034dfe1130aafbb
|
4
|
+
data.tar.gz: 9028b37ecd050d7b72a9899648646c1d4ad264a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc66f30118970d7d9650d88a6cb41a554c80287a43c20dde5dcfa41cc2376b81e16e3d9d2cb3d6733b80d664d9abe602857c0a2c6ec042f35860938b220eb9be
|
7
|
+
data.tar.gz: 243b4ed88d4c256ca3614941fcd5567023559afc6a5aaf8d8e9b67548dbe3ad85e28b33944eca3693eb605e80e2c085ad2c366e244dd523e9f0823e2276cb012
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,7 @@ module ActiveRecord::Turntable
|
|
11
11
|
private
|
12
12
|
|
13
13
|
# @note override for sequencer injection
|
14
|
+
# @see https://github.com/zdennis/activerecord-import/blob/ba909fed5a4785fe9c7cce89e48e1242bb6804ea/lib/activerecord-import/import.rb#L558-L581
|
14
15
|
def values_sql_for_columns_and_attributes_with_turntable(columns, array_of_attributes)
|
15
16
|
connection_memo = connection
|
16
17
|
array_of_attributes.map do |arr|
|
@@ -24,11 +25,13 @@ module ActiveRecord::Turntable
|
|
24
25
|
else
|
25
26
|
connection_memo.next_value_for_sequence(sequence_name)
|
26
27
|
end
|
27
|
-
|
28
|
-
if
|
29
|
-
connection_memo.quote(
|
30
|
-
|
31
|
-
connection_memo.quote(val, column)
|
28
|
+
elsif column
|
29
|
+
if respond_to?(:type_caster) && type_caster.respond_to?(:type_cast_for_database) # Rails 5.0 and higher
|
30
|
+
connection_memo.quote(type_caster.type_cast_for_database(column.name, val))
|
31
|
+
elsif column.respond_to?(:type_cast_from_user) # Rails 4.2 and higher
|
32
|
+
connection_memo.quote(column.type_cast_from_user(val), column)
|
33
|
+
else # Rails 3.1, 3.2, and 4.1
|
34
|
+
connection_memo.quote(column.type_cast(val), column)
|
32
35
|
end
|
33
36
|
end
|
34
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-turntable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gussan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -522,3 +522,4 @@ test_files:
|
|
522
522
|
- spec/spec_helper.rb
|
523
523
|
- spec/support/matchers/be_saved_to.rb
|
524
524
|
- spec/support/turntable_helper.rb
|
525
|
+
has_rdoc:
|