activerecord-bixformer 0.2.0 → 0.2.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: 525850c477621e80252c030d003cdfafedb124ad
4
- data.tar.gz: c1b5d75f0fedc2d7cd5b0506f7d4d17e5ee3ec40
3
+ metadata.gz: 00e9b24b92407ae36d6e54ec0baea46b42b8d6dd
4
+ data.tar.gz: 78ab0a18aa7407a29ec2e367d325cacf38ccb7e2
5
5
  SHA512:
6
- metadata.gz: fdb0105819005d89f3c70ef030c2ce2316683f981687f7cf35a038074b7771646c4ed9f0350a00b7624a3f6711ef3d4a9ab20fc6636f6f934b98f4fe72e9bcfc
7
- data.tar.gz: 4d8a6bab8708bfd6fb640ed0baaa7665db1dd66ac53207d0011dfceb4af18da9d821a751d14172e1f9e76628cc454881cd29ba924d595c25e7750390d0547c58
6
+ metadata.gz: 9711f06d78d4f34e51f6aa606dcd354ec35ecbf19788cf901510c64c45cfb7de06816bf293cb3ecdfa0cdc17b46f40a1e6c7311a372a6fe9e7d77142345a39d3
7
+ data.tar.gz: b60e586431292a13c98ae4c74579552e86eb6d6d6b900cfaebedcaa2f04808aeac7ceba0d25a15f41310b5805eef44f25179183b9797d3f4c2154409e53a4c9d
@@ -39,12 +39,6 @@ module ActiveRecord
39
39
  ]
40
40
  end
41
41
 
42
- def parse_self_data_source(csv_row)
43
- csv_row
44
- end
45
-
46
- private
47
-
48
42
  def csv_title(attribute_name)
49
43
  @translator.translate_attribute(attribute_name)
50
44
  end
@@ -39,6 +39,14 @@ module ActiveRecord
39
39
  end
40
40
  end
41
41
 
42
+ def csv_title(attribute_name)
43
+ if parents.find { |parent| parent.is_a?(::ActiveRecord::Bixformer::Model::Csv::Indexed) }
44
+ parents.map { |parent| parent.translator.translate_model }.join + super
45
+ else
46
+ super
47
+ end
48
+ end
49
+
42
50
  private
43
51
 
44
52
  def update_translator(index)
@@ -48,14 +56,6 @@ module ActiveRecord
48
56
  [attr.name, { index: index }]
49
57
  end.to_h
50
58
  end
51
-
52
- def csv_title(attribute_name)
53
- if parents.find { |parent| parent.is_a?(::ActiveRecord::Bixformer::Model::Csv::Indexed) }
54
- parents.map { |parent| parent.translator.translate_model }.join + super
55
- else
56
- super
57
- end
58
- end
59
59
  end
60
60
  end
61
61
  end
@@ -12,7 +12,7 @@ module ActiveRecord
12
12
  end
13
13
 
14
14
  def value_of(config_name)
15
- @plan.__send__(config_name)
15
+ @plan.__send__(config_name).dup
16
16
  end
17
17
 
18
18
  def pickup_value_for(model, config_name, default_value = nil)
@@ -120,10 +120,15 @@ module ActiveRecord
120
120
  end
121
121
 
122
122
  def module_load_namespaces(module_type)
123
+ module_type_namespace = module_type.to_s.camelize
124
+
125
+ plan_namespace = @plan.class.__bixformer_namespace
126
+ plan_namespace = "#{plan_namespace.camelize}::#{module_type_namespace}" if plan_namespace
127
+
123
128
  [
124
- @plan.class.__bixformer_namespace,
125
- "::ActiveRecord::Bixformer::#{module_type.to_s.camelize}::#{@plan.__bixformer_format.camelize}",
126
- "::ActiveRecord::Bixformer::#{module_type.to_s.camelize}",
129
+ plan_namespace,
130
+ "::ActiveRecord::Bixformer::#{module_type_namespace}::#{@plan.__bixformer_format.camelize}",
131
+ "::ActiveRecord::Bixformer::#{module_type_namespace}",
127
132
  ].compact
128
133
  end
129
134
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Bixformer
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-bixformer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroaki Otsu