activerecord-bixformer 0.3.11 → 0.3.12
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3667d87da3e07b91f9b2503f6a50a68f2df1ce8
|
4
|
+
data.tar.gz: 2843f952ab85cc1c703453abd410474cb5a1cbbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbd484c941c19e05e1468b523d8dc1fb840140bb2bbc4a1e024a911c558de59c496a889f97054be043f6381da00c0407d8696fb0f282984bc5dd7084c6620f85
|
7
|
+
data.tar.gz: 336495e16118c229f7188e8b92c8117a3e4b1d09d448e925c2efa84be468289c175f307917589a4cf2a412811f64480d7677bf446dff2950238d9ca794de3152
|
@@ -8,14 +8,20 @@ module ActiveRecord
|
|
8
8
|
@plan = ActiveRecord::Bixformer::PlanAccessor.new(plan)
|
9
9
|
end
|
10
10
|
|
11
|
+
def clear
|
12
|
+
@model = nil
|
13
|
+
end
|
14
|
+
|
11
15
|
def compile
|
12
|
-
|
16
|
+
@model ||= -> do
|
17
|
+
model_type, model_options = @plan.parse_to_type_and_options(@plan.value_of(:entry)[:type])
|
13
18
|
|
14
|
-
|
19
|
+
model = @plan.new_module_instance(:model, model_type, @model_name, model_options)
|
15
20
|
|
16
|
-
|
21
|
+
compile_model(model)
|
17
22
|
|
18
|
-
|
23
|
+
model
|
24
|
+
end.call
|
19
25
|
end
|
20
26
|
|
21
27
|
def should_be_included
|
@@ -6,15 +6,20 @@ module ActiveRecord
|
|
6
6
|
super(:csv, plan)
|
7
7
|
end
|
8
8
|
|
9
|
+
def clear
|
10
|
+
super
|
11
|
+
|
12
|
+
@csv_title_row = nil
|
13
|
+
end
|
14
|
+
|
9
15
|
def csv_title_row
|
10
|
-
compile.csv_titles
|
16
|
+
@csv_title_row ||= compile.csv_titles
|
11
17
|
end
|
12
18
|
|
13
19
|
def csv_body_row(activerecord)
|
14
|
-
|
15
|
-
body_map = model.export(activerecord)
|
20
|
+
body_map = compile.export(activerecord)
|
16
21
|
|
17
|
-
|
22
|
+
csv_title_row.map { |title| body_map[title] }
|
18
23
|
end
|
19
24
|
end
|
20
25
|
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.3.
|
4
|
+
version: 0.3.12
|
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-
|
11
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|