activerecord-bixformer 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00e9b24b92407ae36d6e54ec0baea46b42b8d6dd
|
4
|
+
data.tar.gz: 78ab0a18aa7407a29ec2e367d325cacf38ccb7e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9711f06d78d4f34e51f6aa606dcd354ec35ecbf19788cf901510c64c45cfb7de06816bf293cb3ecdfa0cdc17b46f40a1e6c7311a372a6fe9e7d77142345a39d3
|
7
|
+
data.tar.gz: b60e586431292a13c98ae4c74579552e86eb6d6d6b900cfaebedcaa2f04808aeac7ceba0d25a15f41310b5805eef44f25179183b9797d3f4c2154409e53a4c9d
|
@@ -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
|
-
|
125
|
-
"::ActiveRecord::Bixformer::#{
|
126
|
-
"::ActiveRecord::Bixformer::#{
|
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
|