activerecord-bixformer 0.4.13 → 0.4.14

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
  SHA1:
3
- metadata.gz: 18a1d0fe7e88548ee68e8c40d795a239b931195c
4
- data.tar.gz: fc576daa90e40135a7c5c5fc8c5f912f4e55a800
3
+ metadata.gz: ece796f327a3cf4bcf833c066b98121ef08a02a3
4
+ data.tar.gz: a48f51c405fed75321430c14b0a75f16f3c7ee52
5
5
  SHA512:
6
- metadata.gz: 5896a50008272eba1bbf62e5476a0321ab337110fa5fe9c388f9f20301d7c0c2e3c0c7a5cdfa4395c603074829ffa5594963f882f047fb65d83e20ac8151624b
7
- data.tar.gz: 7d4afa28dd6db8883d4bd3e30840f5bb07efb5fe126f1e6be273a7d8e894dd400f39edb0f9b323ceb1a6f8d15536ef925cebbb2ae0022ba116625d1eb7eef247
6
+ metadata.gz: 34db4f8782098149e84d145ed0ae9d496cfe0753d2771aa1e5cc7337d268e0848aba6558bd56c1deb0c442c559e6497f72deafa4436a2e6208c0f7cddad7af4b
7
+ data.tar.gz: 7aa3470ff539d7c68fd5e5a6cd25c75f323809b69c51e13a4ab92dd4b0ce0a96331394cab3b9e7d4c78b7634685dfb6a04b1d396d8113db4bc809656ee6b80a9
@@ -145,8 +145,8 @@ module ActiveRecord
145
145
 
146
146
  private
147
147
 
148
- def make_each_attribute_import_value(parent_record_id = nil, &block)
149
- values = {}.with_indifferent_access
148
+ def make_each_attribute_import_value(parent_record_id = nil, initializer: {}, &block)
149
+ values = initializer.with_indifferent_access
150
150
  normalizer = ::ActiveRecord::Bixformer::AssignableAttributesNormalizer.new(plan, self, parent_record_id)
151
151
 
152
152
  run_bixformer_callback :import, type: :attribute do
@@ -68,8 +68,8 @@ module ActiveRecord
68
68
  end
69
69
  end
70
70
 
71
- def do_import(csv_body_row, parent_record_id = nil)
72
- values = make_each_attribute_import_value(parent_record_id) do |attr|
71
+ def do_import(csv_body_row, parent_record_id = nil, initializer: {})
72
+ values = make_each_attribute_import_value(parent_record_id, initializer: initializer) do |attr|
73
73
  attr.import(csv_body_row[csv_title(attr.name)])
74
74
  end
75
75
 
@@ -33,9 +33,7 @@ module ActiveRecord
33
33
  @options[:in].map do |key|
34
34
  update_translator(key)
35
35
 
36
- do_import(csv_body_row, parent_record_id).tap do |o|
37
- o[@options[:key]] = key if presence_value?(o)
38
- end
36
+ do_import(csv_body_row, parent_record_id, initializer: { @options[:key] => key })
39
37
  end
40
38
  end
41
39
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Bixformer
3
- VERSION = "0.4.13"
3
+ VERSION = "0.4.14"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-bixformer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.13
4
+ version: 0.4.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroaki Otsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-17 00:00:00.000000000 Z
11
+ date: 2016-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord