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: c9925e8594c361459fef18234ff7b4e15d712f5c
4
- data.tar.gz: a8d958172d8917882fc7755956e8199179338fb7
3
+ metadata.gz: c476ca06fe32521466081db5b034dfe1130aafbb
4
+ data.tar.gz: 9028b37ecd050d7b72a9899648646c1d4ad264a7
5
5
  SHA512:
6
- metadata.gz: d7689b939906852fd6218d0ce4168c3f55fcb10c817abbf07d910f32d3b7596cc9e3fa328061658b8396c2c624629679fa826791b97e409bede0f8533d176769
7
- data.tar.gz: 5b9efb2e4302bdac577741f69d6290a4fd0facc30920d9c179efb0625741e07abc04f505b0ab6586405012cba0a3b0a266bfe0df3dc145ce4428c35c602640c9
6
+ metadata.gz: dc66f30118970d7d9650d88a6cb41a554c80287a43c20dde5dcfa41cc2376b81e16e3d9d2cb3d6733b80d664d9abe602857c0a2c6ec042f35860938b220eb9be
7
+ data.tar.gz: 243b4ed88d4c256ca3614941fcd5567023559afc6a5aaf8d8e9b67548dbe3ad85e28b33944eca3693eb605e80e2c085ad2c366e244dd523e9f0823e2276cb012
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## activerecord-turntable 2.3.2 ##
2
+
3
+ ### Improvement
4
+
5
+ * ActiveRecord::Import follow ActiveRecord 5 (thx mitaku)
6
+
1
7
  ## activerecord-turntable 2.3.1 ##
2
8
 
3
9
  ### Improvement
@@ -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
- else
28
- if serialized_attributes.include?(column.name)
29
- connection_memo.quote(serialized_attributes[column.name].dump(val), column)
30
- else
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
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Turntable
3
- VERSION = "2.3.1"
3
+ VERSION = "2.3.2"
4
4
  end
5
5
  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.1
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-02-12 00:00:00.000000000 Z
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: