spreadsheet_architect 1.1.0 → 1.2.0

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: aecd3d727c30feaf79f0838b51fbab5d2a2d4179
4
- data.tar.gz: 120005b9f5b0b987d7d66dada11f306003bab336
3
+ metadata.gz: d646197e6c3312af6863833c39540315400367bc
4
+ data.tar.gz: 396ee2ed11e98ba2597a5089e6b3527040d1005d
5
5
  SHA512:
6
- metadata.gz: ae91411764f7d32eebbc13b99b6b37bbe560a4221dbbb7a489a4db37e9c7c0c0d868ef3054ef1f5dbefe23485b2f448e5ae9c75ec49dba6a4025e7a651bd8967
7
- data.tar.gz: 68058e1003fe7ab9c4ee244dd870886b1b89afc9719df958fea6c130d89c1f63d384be97bc672e5e1f1db0a8e04b094d321b4a7bef789924e74cb8a514196516
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 `spreadseheet_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.
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
- data.push columns.map{|col| col.is_a?(String) ? col : instance.instance_eval(col.to_s)}
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)
@@ -1,3 +1,3 @@
1
1
  module SpreadsheetArchitect
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
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.1.0
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-03 00:00:00.000000000 Z
11
+ date: 2016-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: axlsx