xlsxtream_rails 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xlsxtream_rails/action_controller.rb +4 -2
- data/lib/xlsxtream_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5502fc92614bd2379b7af762136ac5d37621264a14a8c95dd0c1675c06f8f8c1
|
4
|
+
data.tar.gz: cf4eb50326cf589174c1dc941392a12f054d5142c48d2293b210100f37551403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1171bb419c8a365726ed516eb46f53ef6a658462ad1a810629ecec67fb69c040afcbe0c6d41adf785edf7da33161bb41cfd10008d163d5c79ed5ce783c89a81f
|
7
|
+
data.tar.gz: 70566d1a3ff138d3840a343e6e6a6218fd13636764784a87656149856d702f3aa34d48ad5a409221c2ec9da0297adcdc974f09ae5c88abe65601e86269526e58
|
@@ -9,8 +9,10 @@ ActionController::Renderers.add :xlsx do |data, options|
|
|
9
9
|
# disposition / filename
|
10
10
|
options[:disposition] = options.delete(:disposition) || "attachment"
|
11
11
|
|
12
|
-
if defined?(ActiveRecord) && data.is_a?(ActiveRecord::Relation)
|
13
|
-
|
12
|
+
options[:filename] ||= if defined?(ActiveRecord) && data.is_a?(ActiveRecord::Relation)
|
13
|
+
"#{data.klass.model_name.human}_#{Time.now.to_i}"
|
14
|
+
else
|
15
|
+
Time.now.to_i
|
14
16
|
end
|
15
17
|
|
16
18
|
options[:filename] = options[:filename] ? options[:filename].strip.sub(/\.xlsx$/i, "") : "data"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xlsxtream_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- doabit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|