spreadsheet_architect 1.1.0 → 1.2.0
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 +4 -4
- data/README.md +4 -1
- data/lib/spreadsheet_architect.rb +13 -1
- data/lib/spreadsheet_architect/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d646197e6c3312af6863833c39540315400367bc
|
4
|
+
data.tar.gz: 396ee2ed11e98ba2597a5089e6b3527040d1005d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01f1661665236b11978fde9e75b6cccd59871d715b7895ac65b315a8104d689ecb441e55667e04f336bb1c51e22cc139540efb55f0d6567cdd2f8f65de6e14b8
|
7
|
+
data.tar.gz: 352f3163770b4cc63aefad63b79b025464776fa8ec08f861d2492e2c076a4c08677633bad36c150f0b24c32903ad747a89ebf3a0abd8d1a95be394eb367f77d5
|
data/README.md
CHANGED
@@ -16,8 +16,11 @@ Post.order(name: :asc).where(published: true).to_ods
|
|
16
16
|
Post.order(name: :asc).where(published: true).to_csv
|
17
17
|
```
|
18
18
|
|
19
|
+
## Note: Major bug fix in 1.2.0
|
20
|
+
v.1.1.0 had a major bug in it where it would use only the first records data for non-symbol methods. Please update to 1.2.0 from 1.1.0 as soon as possible.
|
21
|
+
|
19
22
|
## Note: Breaking Changes in 1.1.0
|
20
|
-
The `
|
23
|
+
The `spreadsheet_columns` method has been moved from the class to the instance. So now you can use string interpolation in your values. Please re-read the Model section below to see the changes. The side effect of this is if you are using the spreadsheet_columns option directly on the .to_* methods.
|
21
24
|
|
22
25
|
|
23
26
|
# Install
|
@@ -51,7 +51,19 @@ module SpreadsheetArchitect
|
|
51
51
|
|
52
52
|
data = []
|
53
53
|
options[:data].each do |instance|
|
54
|
-
|
54
|
+
if has_custom_columns && !options[:spreadsheet_columns]
|
55
|
+
row_data = []
|
56
|
+
instance.spreadsheet_columns.each do |x|
|
57
|
+
if x.is_a?(Array)
|
58
|
+
row_data.push(x[1].is_a?(Symbol) ? instance.instance_eval(x[1].to_s) : x[1])
|
59
|
+
else
|
60
|
+
row_data.push(x.is_a?(Symbol) ? instance.instance_eval(x.to_s) : x)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
data.push row_data
|
64
|
+
else
|
65
|
+
data.push columns.map{|col| col.is_a?(Symbol) ? instance.instance_eval(col.to_s) : col}
|
66
|
+
end
|
55
67
|
end
|
56
68
|
|
57
69
|
headers = (options[:headers] == false ? false : headers)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreadsheet_architect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Weston Ganger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: axlsx
|