as_csv 3.0.0 → 3.0.1
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/CHANGELOG.md +6 -0
- data/lib/as_csv/railtie.rb +23 -4
- data/lib/as_csv/version.rb +1 -1
- data/lib/as_csv.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8af870672a5c660bf534d462e8bc5cb16b4212a944c6ea471196f54cc5c422f6
|
4
|
+
data.tar.gz: fb419f709a93da5293e05315b2ffa0cb41c3adb9d3dc81b61534717198e3dfbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 821778f8b9ba8e2ec23297361cd1d5311a824a9c153fabf1a5c2bbe6a9c669ef62c28f3b45825e1496ace0fd2e866a17dd51613a81f74fefeb4ef5550cc83567
|
7
|
+
data.tar.gz: 3057fef0b1dea2f0d353e2094a377544527d0e1209ca2139e7cfe6019c425dab4f0262d7069b45437c2b84b33b8e4c8cff44c39c792d1d1e8d3d86ff0029c390
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [3.0.1] - 2022-11-08
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
- Improved support for Rails 7 by using a proper Railtie.
|
11
|
+
|
6
12
|
## [3.0.0] - 2022-11-08
|
7
13
|
|
8
14
|
### Added
|
data/lib/as_csv/railtie.rb
CHANGED
@@ -1,8 +1,27 @@
|
|
1
1
|
require 'as_csv/active_model/serialization/csv'
|
2
2
|
|
3
|
-
|
3
|
+
# Use the Railtie to hook into the Rails initialization process
|
4
|
+
module AsCsv
|
5
|
+
class Railtie < Rails::Railtie
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
7
|
+
initializer "as_csv" do
|
8
|
+
|
9
|
+
# Include the CSV serialization module into ActiveRecord::Base and
|
10
|
+
# ActiveModel::Serialization
|
11
|
+
ActiveSupport.on_load :active_record do
|
12
|
+
ActiveRecord::Base.send :include, AsCSV::ActiveModel::Serialization::CSV
|
13
|
+
ActiveModel::Serialization.send :include, AsCSV::ActiveModel::Serialization::CSV
|
14
|
+
end
|
15
|
+
|
16
|
+
# Add a :csv renderer to ActionController::Renderers
|
17
|
+
ActiveSupport.on_load :action_controller do
|
18
|
+
ActionController::Renderers.add :csv do |obj, options|
|
19
|
+
response.headers['Content-Disposition'] = 'attachment'
|
20
|
+
obj.respond_to?(:to_csv) ? obj.to_csv(options) : obj
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
8
27
|
end
|
data/lib/as_csv/version.rb
CHANGED
data/lib/as_csv.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: as_csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Fone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
|
-
rubygems_version: 3.3.
|
133
|
+
rubygems_version: 3.3.23
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Instant CSV support for Rails
|