spreadsheet_architect 1.2.5 → 1.2.6

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: 21c5867f27c722dc492fb066f9df3ab24e9a2546
4
- data.tar.gz: 215bdbccb2fbac76ad79cfd532fe6664d3569102
3
+ metadata.gz: 6f9b780d8d8faee0db9db691acc6ac42e9e84dd0
4
+ data.tar.gz: 2032d74569653b1f7cda5ec7b1d51ab7fdbcccc5
5
5
  SHA512:
6
- metadata.gz: 4218ffd1ff6e3477019a1cde6a14d2aca236d0e5304657b878b26c1a2a833389855079b9ee845fba312baca8a36796d59fad3fd9c577d3fa9140ba17ee373f9b
7
- data.tar.gz: 01f65826a09773165cf1c5c7c66f62e1aadb2bf1d25cd7aac6e3cfb7432b57c277d2e092962487eeeb96c276a07f1158bcebe93a92c715110f99635671a0a465
6
+ metadata.gz: b95116195dbc983f0c71622f690071b706fd44405cf6a813fa7f3922cd06d63ed6d81ea50a85480417d9eac4fee3baf328f94e71a6b59cdacf8c1a9207010c74
7
+ data.tar.gz: 65fadde69748e88ba5881b1c0d1a2da9a5883bacc925a62c58f3652aba24b1700b39d30372a38636b8fd58187a2ba233f00258ea653301298a9aae90a204beb1
data/README.md CHANGED
@@ -52,11 +52,11 @@ class Post < ActiveRecord::Base #activerecord not required
52
52
  ['Category/Tags', "#{category.name} - #{tags.collect(&:name).join(', ')}"]
53
53
  ]
54
54
 
55
- # OR just humanize the method to use as the label ex. "Title", "Content", "Author Name", "Published"
56
- [:title, content, (author.name rescue nil), :published]
55
+ # OR if you want to use the method or attribute name as a label it must be a symbol ex. "Title", "Content", "Published"
56
+ [:title, :content, :published]
57
57
 
58
- # OR a Combination of Both
59
- [:title, :content, ['Author',(author.name rescue nil)], :published]
58
+ # OR a Combination of Both ex. "Title", "Content", "Author Name", "Published"
59
+ [:title, :content, ['Author Name',(author.name rescue nil)], :published]
60
60
  end
61
61
  end
62
62
  ```
@@ -163,3 +163,6 @@ Only the generic options
163
163
  Created by Weston Ganger - @westonganger
164
164
 
165
165
  Heavily influenced by the dead gem `acts_as_xlsx` by @randym but adapted to work for more spreadsheet types and plain ruby models.
166
+
167
+
168
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VKY8YAWAS5XRQ&lc=CA&item_name=Weston%20Ganger&item_number=spreadsheet_architect&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest" target="_blank" title="Donate"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" alt="Donate"/></a>
@@ -1,21 +1,21 @@
1
1
  if defined? ActionController
2
2
  ActionController::Renderers.add :xlsx do |data, options|
3
3
  if data.is_a?(ActiveRecord::Relation)
4
- options[:filename] = data.model.name.pluralize
4
+ options[:filename] = data.klass.name.pluralize
5
5
  data = data.to_xlsx
6
6
  end
7
7
  send_data data, type: :xlsx, disposition: :attachment, filename: "#{options[:filename] ? options[:filename].sub('.xlsx','') : 'data'}.xlsx"
8
8
  end
9
9
  ActionController::Renderers.add :ods do |data, options|
10
10
  if data.is_a?(ActiveRecord::Relation)
11
- options[:filename] = data.model.name.pluralize
11
+ options[:filename] = data.klass.name.pluralize
12
12
  data = data.to_ods
13
13
  end
14
14
  send_data data, type: :ods, disposition: :attachment, filename: "#{options[:filename] ? options[:filename].sub('.ods','') : 'data'}.ods"
15
15
  end
16
16
  ActionController::Renderers.add :csv do |data, options|
17
17
  if data.is_a?(ActiveRecord::Relation)
18
- options[:filename] = data.model.name.pluralize
18
+ options[:filename] = data.klass.name.pluralize
19
19
  data = data.to_csv
20
20
  end
21
21
  send_data data, type: :csv, disposition: :attachment, filename: "#{options[:filename] ? options[:filename].sub('.csv','') : 'data'}.csv"
@@ -1,3 +1,3 @@
1
1
  module SpreadsheetArchitect
2
- VERSION = "1.2.5"
2
+ VERSION = "1.2.6"
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.2.5
4
+ version: 1.2.6
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-25 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: axlsx
@@ -127,7 +127,6 @@ files:
127
127
  - lib/spreadsheet_architect/version.rb
128
128
  - test/database.yml
129
129
  - test/helper.rb
130
- - test/spreadsheet_architect.sqlite3.db
131
130
  - test/tc_spreadsheet_architect.rb
132
131
  homepage: https://github.com/westonganger/spreadsheet_architect
133
132
  licenses: []
@@ -148,12 +147,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
147
  version: '0'
149
148
  requirements: []
150
149
  rubyforge_project:
151
- rubygems_version: 2.5.2
150
+ rubygems_version: 2.5.1
152
151
  signing_key:
153
152
  specification_version: 4
154
153
  summary: Spreadsheet Generator for ActiveRecord Models and Ruby Classes/Modules
155
154
  test_files:
156
- - test/database.yml
157
155
  - test/helper.rb
158
- - test/spreadsheet_architect.sqlite3.db
156
+ - test/database.yml
159
157
  - test/tc_spreadsheet_architect.rb
Binary file