rexport 1.0.0 → 1.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/README.rdoc +1 -1
- data/lib/rexport/exports_controller_methods.rb +17 -12
- data/lib/rexport/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d5b63f741d1c73f9cf4566d3c73f89ef5b1435eac608878eabac49f8cfce8de
|
4
|
+
data.tar.gz: 557b40e69b7e8fe5f31c3dd7ccea61b55994a3d799ae200c9cd2454990b58fd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a00c4cecd34a713330f2ef1181814c40e5dfa00a5035a7c41b1aec0930681f00fcb0d2550e9dc15295878974984afae144fff5c897f4cadf6caea7c8f7cec052
|
7
|
+
data.tar.gz: 44c31d22fdc3ae434974bcec1a695bc0b6dbeeeb536d7ba9eb5468b678ee7996a452aaa3eb187c462b6f9022b77780a062dcb125f5f06b0e3677a76b9341bc70
|
data/README.rdoc
CHANGED
@@ -5,11 +5,11 @@ module Rexport
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def show
|
8
|
-
|
8
|
+
export
|
9
9
|
|
10
10
|
respond_to do |format|
|
11
11
|
format.html # show.html.erb
|
12
|
-
format.csv { send_data(
|
12
|
+
format.csv { send_data(export.to_csv, type: export_content_type, filename: filename) }
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -18,7 +18,7 @@ module Rexport
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def edit
|
21
|
-
|
21
|
+
export
|
22
22
|
end
|
23
23
|
|
24
24
|
def create
|
@@ -32,32 +32,37 @@ module Rexport
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def update
|
35
|
-
|
36
|
-
|
37
|
-
if @export.update_attributes(export_params)
|
38
|
-
redirect_to @export, notice: 'Export was successfully updated.'
|
35
|
+
if export.update_attributes(export_params)
|
36
|
+
redirect_to export, notice: 'Export was successfully updated.'
|
39
37
|
else
|
40
38
|
render :edit
|
41
39
|
end
|
42
40
|
end
|
43
41
|
|
44
42
|
def destroy
|
45
|
-
|
46
|
-
@export.destroy
|
43
|
+
export.destroy
|
47
44
|
|
48
45
|
redirect_to exports_url
|
49
46
|
end
|
50
47
|
|
51
48
|
private
|
52
49
|
|
50
|
+
def export
|
51
|
+
@export ||= Export.find(params[:id])
|
52
|
+
end
|
53
|
+
|
53
54
|
def export_params
|
54
|
-
params.require(:export).permit(
|
55
|
+
params.require(:export).permit(permitted_params)
|
56
|
+
end
|
57
|
+
|
58
|
+
def permitted_params
|
59
|
+
[
|
55
60
|
:name,
|
56
61
|
:model_class_name,
|
57
62
|
:description,
|
58
63
|
rexport_fields: {},
|
59
64
|
export_filter_attributes: {}
|
60
|
-
|
65
|
+
]
|
61
66
|
end
|
62
67
|
|
63
68
|
def export_content_type
|
@@ -65,7 +70,7 @@ module Rexport
|
|
65
70
|
end
|
66
71
|
|
67
72
|
def filename
|
68
|
-
"#{
|
73
|
+
"#{export.model_class_name}_#{export.name.gsub(/ /, '_')}_#{Time.now.strftime('%Y%m%d')}.csv"
|
69
74
|
end
|
70
75
|
end
|
71
76
|
end
|
data/lib/rexport/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Baldwin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-07-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -135,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
|
139
|
-
rubygems_version: 2.7.7
|
138
|
+
rubygems_version: 3.0.4
|
140
139
|
signing_key:
|
141
140
|
specification_version: 4
|
142
141
|
summary: Ruby on Rails gem to manage exports.
|