activerecord-bixformer 0.4.18 → 0.4.19
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: 440c53f937e017a28463e594ffc9057a3f2b1b03
|
4
|
+
data.tar.gz: 112e9462e462dacadd0661cba1cda7166df41029
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59a354bdf15342906e8154b0f744b29fbab11c97da83dd0e5ba204f805f814174c69f2c84a662beea39c4a81f465a30631f5e284a7a4aa25065e1cf67073e44c
|
7
|
+
data.tar.gz: 16beecf99c514c544cba9307e6c7f1a735a6faaff159323b9e9670e4faf2becf985de8b247dff407de8d06694a16fa0f782c49679d67c3cbc043e792ff0a5074
|
@@ -151,6 +151,8 @@ module ActiveRecord
|
|
151
151
|
|
152
152
|
run_bixformer_callback :import, type: :attribute do
|
153
153
|
@attributes.each do |attr|
|
154
|
+
next if attr.options[:skip_import]
|
155
|
+
|
154
156
|
attribute_value = begin
|
155
157
|
run_bixformer_callback :import, on: attr.name do
|
156
158
|
block.call(attr)
|
@@ -20,10 +20,14 @@ module ActiveRecord
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def verify_csv_titles(csv_title_row)
|
23
|
-
|
23
|
+
verified_attribute_names = if options[:verified_csv_titles]
|
24
|
+
options[:verified_csv_titles].map(&:to_s)
|
25
|
+
else
|
26
|
+
activerecord_constant.attribute_names
|
27
|
+
end
|
24
28
|
|
25
29
|
@attributes
|
26
|
-
.select { |attr|
|
30
|
+
.select { |attr| verified_attribute_names.include?(attr.name) }
|
27
31
|
.map { |attr| csv_title(attr.name) }
|
28
32
|
.all? { |title| csv_title_row.include?(title) } &&
|
29
33
|
@associations.all? { |ass| ass.verify_csv_titles(csv_title_row) }
|
@@ -45,7 +49,7 @@ module ActiveRecord
|
|
45
49
|
values = run_bixformer_callback :export, type: :attribute do
|
46
50
|
# has_one でしか使わない想定なので record_or_relation は ActiveRecord::Base のはず
|
47
51
|
@attributes.map do |attr|
|
48
|
-
attribute_value = if record_or_relation
|
52
|
+
attribute_value = if record_or_relation && ! attr.options[:skip_export]
|
49
53
|
run_bixformer_callback :export, on: attr.name do
|
50
54
|
attr.export(record_or_relation)
|
51
55
|
end
|