activestorage_legacy 0.1 → 0.1.1.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +1 -0
- data/.github/workflows/ruby-tests.yml +1 -0
- data/.gitignore +2 -0
- data/Gemfile +2 -1
- data/README.md +5 -1
- data/activestorage.gemspec +3 -4
- data/app/models/active_storage/attachment.rb +3 -3
- data/app/models/active_storage/blob.rb +3 -3
- data/lib/active_storage/gem_version.rb +1 -1
- metadata +3 -32
- data/Gemfile.lock +0 -271
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38861fa3326360757802b47e045a59e82add4e89
|
4
|
+
data.tar.gz: cbd0c1f00330494ec383294c412bb476f8d55ee4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75eda55611fcc25cc7748daaa4f865a667b2e5c1f31e066459980d345b023585c96d47b6e24d6e6f36b25423647b5bca6bb53a9fa5fc0458a22899c680a57dda
|
7
|
+
data.tar.gz: a27d898f7c7a45d5aafc28c6786fed32111e0b719eb3d19b054f4c816c80b8bde7ba9583615033fbbcd20e36b3e225f97ea673c05222f29a0bc882d4f81faa8f
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,11 @@ See the complete list of changes in https://github.com/rails/activestorage/compa
|
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
|
-
1. Add `
|
12
|
+
1. Add `activestorage_legacy` and `strong_parameters` to your Gemfile:
|
13
|
+
```ruby
|
14
|
+
gem 'strong_parameters'
|
15
|
+
gem 'activestorage_legacy'
|
16
|
+
```
|
13
17
|
2. Add `require "active_storage"` to config/application.rb, after `require "rails/all"` line.
|
14
18
|
3. Run `rake activestorage:install` to create needed directories, migrations, and configuration.
|
15
19
|
4. Configure the storage service in `config/environments/*` with `config.active_storage.service = :local`
|
data/activestorage.gemspec
CHANGED
@@ -3,9 +3,11 @@
|
|
3
3
|
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
|
4
4
|
end
|
5
5
|
|
6
|
+
require_relative "lib/active_storage/version"
|
7
|
+
|
6
8
|
Gem::Specification.new do |s|
|
7
9
|
s.name = "activestorage_legacy"
|
8
|
-
s.version =
|
10
|
+
s.version = ActiveStorage.version
|
9
11
|
s.authors = "David Heinemeier Hansson"
|
10
12
|
s.email = "david@basecamp.com"
|
11
13
|
s.summary = "Attach cloud and local files in Rails applications"
|
@@ -16,12 +18,9 @@ Gem::Specification.new do |s|
|
|
16
18
|
|
17
19
|
s.add_dependency "rails", ">= 3.2.22.4"
|
18
20
|
s.add_dependency "sidekiq", ">= 4.2.0"
|
19
|
-
s.add_dependency "strong_parameters"
|
20
21
|
s.add_dependency "mini_magick", ">= 4.0"
|
21
22
|
s.add_dependency "marcel", ">= 1.0"
|
22
23
|
|
23
|
-
s.add_development_dependency "bundler", "~> 1.15"
|
24
|
-
|
25
24
|
s.files = `git ls-files`.split("\n")
|
26
25
|
s.test_files = `git ls-files -- test/*`.split("\n")
|
27
26
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "active_storage/blob"
|
2
2
|
require "active_storage/patches/delegation"
|
3
|
-
require "strong_parameters"
|
3
|
+
require "strong_parameters" if Rails.version < '4.0'
|
4
4
|
|
5
5
|
# Attachments associate records with blobs. Usually that's a one record-many blobs relationship,
|
6
6
|
# but it is possible to associate many different records with the same blob. If you're doing that,
|
@@ -9,8 +9,8 @@ require "strong_parameters"
|
|
9
9
|
class ActiveStorage::Attachment < ActiveRecord::Base
|
10
10
|
self.table_name = "active_storage_attachments"
|
11
11
|
|
12
|
-
attr_protected
|
13
|
-
include ActiveModel::ForbiddenAttributesProtection
|
12
|
+
attr_protected if defined?(attr_protected)
|
13
|
+
include ActiveModel::ForbiddenAttributesProtection if defined?(ActiveModel::ForbiddenAttributesProtection)
|
14
14
|
|
15
15
|
belongs_to :record, polymorphic: true
|
16
16
|
belongs_to :blob, class_name: "ActiveStorage::Blob"
|
@@ -4,7 +4,7 @@ require "active_storage/purge_blob_worker"
|
|
4
4
|
require "active_storage/purge_attachment_worker"
|
5
5
|
require "active_storage/variant"
|
6
6
|
require "active_storage/variation"
|
7
|
-
require "strong_parameters"
|
7
|
+
require "strong_parameters" if Rails.version < '4.0'
|
8
8
|
|
9
9
|
# A blob is a record that contains the metadata about a file and a key for where that file resides on the service.
|
10
10
|
# Blobs can be created in two ways:
|
@@ -22,8 +22,8 @@ require "strong_parameters"
|
|
22
22
|
class ActiveStorage::Blob < ActiveRecord::Base
|
23
23
|
self.table_name = "active_storage_blobs"
|
24
24
|
|
25
|
-
attr_protected
|
26
|
-
include ActiveModel::ForbiddenAttributesProtection
|
25
|
+
attr_protected if defined?(attr_protected)
|
26
|
+
include ActiveModel::ForbiddenAttributesProtection if defined?(ActiveModel::ForbiddenAttributesProtection)
|
27
27
|
|
28
28
|
has_secure_token :key
|
29
29
|
store :metadata, coder: JSON
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage_legacy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 4.2.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: strong_parameters
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: mini_magick
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,20 +66,6 @@ dependencies:
|
|
80
66
|
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '1.0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: bundler
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.15'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.15'
|
97
69
|
description:
|
98
70
|
email: david@basecamp.com
|
99
71
|
executables: []
|
@@ -109,7 +81,6 @@ files:
|
|
109
81
|
- ".rubocop.yml"
|
110
82
|
- ".travis.yml"
|
111
83
|
- Gemfile
|
112
|
-
- Gemfile.lock
|
113
84
|
- MIT-LICENSE
|
114
85
|
- README.md
|
115
86
|
- Rakefile
|
@@ -249,9 +220,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
249
220
|
version: 2.2.2
|
250
221
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
251
222
|
requirements:
|
252
|
-
- - "
|
223
|
+
- - ">"
|
253
224
|
- !ruby/object:Gem::Version
|
254
|
-
version:
|
225
|
+
version: 1.3.1
|
255
226
|
requirements: []
|
256
227
|
rubyforge_project:
|
257
228
|
rubygems_version: 2.5.2.3
|
data/Gemfile.lock
DELETED
@@ -1,271 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: https://github.com/dixpac/azure-ruby-asm-core.git
|
3
|
-
revision: 4403389747f44a94b73e7a7522d1ea11f8b1a266
|
4
|
-
specs:
|
5
|
-
azure-core (0.1.8)
|
6
|
-
faraday (~> 0.9)
|
7
|
-
faraday_middleware (~> 0.10)
|
8
|
-
nokogiri (~> 1.7)
|
9
|
-
|
10
|
-
PATH
|
11
|
-
remote: .
|
12
|
-
specs:
|
13
|
-
activestorage_legacy (0.1)
|
14
|
-
marcel (>= 1.0)
|
15
|
-
mini_magick (>= 4.0)
|
16
|
-
rails (>= 3.2.22.4)
|
17
|
-
sidekiq (>= 4.2.0)
|
18
|
-
strong_parameters
|
19
|
-
|
20
|
-
GEM
|
21
|
-
remote: https://rubygems.org/
|
22
|
-
specs:
|
23
|
-
actionmailer (3.2.22.5)
|
24
|
-
actionpack (= 3.2.22.5)
|
25
|
-
mail (~> 2.5.4)
|
26
|
-
actionpack (3.2.22.5)
|
27
|
-
activemodel (= 3.2.22.5)
|
28
|
-
activesupport (= 3.2.22.5)
|
29
|
-
builder (~> 3.0.0)
|
30
|
-
erubis (~> 2.7.0)
|
31
|
-
journey (~> 1.0.4)
|
32
|
-
rack (~> 1.4.5)
|
33
|
-
rack-cache (~> 1.2)
|
34
|
-
rack-test (~> 0.6.1)
|
35
|
-
sprockets (~> 2.2.1)
|
36
|
-
activemodel (3.2.22.5)
|
37
|
-
activesupport (= 3.2.22.5)
|
38
|
-
builder (~> 3.0.0)
|
39
|
-
activerecord (3.2.22.5)
|
40
|
-
activemodel (= 3.2.22.5)
|
41
|
-
activesupport (= 3.2.22.5)
|
42
|
-
arel (~> 3.0.2)
|
43
|
-
tzinfo (~> 0.3.29)
|
44
|
-
activeresource (3.2.22.5)
|
45
|
-
activemodel (= 3.2.22.5)
|
46
|
-
activesupport (= 3.2.22.5)
|
47
|
-
activesupport (3.2.22.5)
|
48
|
-
i18n (~> 0.6, >= 0.6.4)
|
49
|
-
multi_json (~> 1.0)
|
50
|
-
addressable (2.8.4)
|
51
|
-
public_suffix (>= 2.0.2, < 6.0)
|
52
|
-
arel (3.0.3)
|
53
|
-
ast (2.3.0)
|
54
|
-
aws-sdk (2.10.7)
|
55
|
-
aws-sdk-resources (= 2.10.7)
|
56
|
-
aws-sdk-core (2.10.7)
|
57
|
-
aws-sigv4 (~> 1.0)
|
58
|
-
jmespath (~> 1.0)
|
59
|
-
aws-sdk-resources (2.10.7)
|
60
|
-
aws-sdk-core (= 2.10.7)
|
61
|
-
aws-sigv4 (1.0.0)
|
62
|
-
azure-storage (0.11.4.preview)
|
63
|
-
azure-core (~> 0.1)
|
64
|
-
faraday (~> 0.9)
|
65
|
-
faraday_middleware (~> 0.10)
|
66
|
-
nokogiri (~> 1.6)
|
67
|
-
builder (3.0.4)
|
68
|
-
byebug (9.0.6)
|
69
|
-
capybara (2.18.0)
|
70
|
-
addressable
|
71
|
-
mini_mime (>= 0.1.3)
|
72
|
-
nokogiri (>= 1.3.3)
|
73
|
-
rack (>= 1.0.0)
|
74
|
-
rack-test (>= 0.5.4)
|
75
|
-
xpath (>= 2.0, < 4.0)
|
76
|
-
concurrent-ruby (1.2.2)
|
77
|
-
connection_pool (2.2.5)
|
78
|
-
declarative (0.0.20)
|
79
|
-
declarative-option (0.1.0)
|
80
|
-
digest-crc (0.6.4)
|
81
|
-
rake (>= 12.0.0, < 14.0.0)
|
82
|
-
docile (1.3.5)
|
83
|
-
erubis (2.7.0)
|
84
|
-
faraday (0.12.1)
|
85
|
-
multipart-post (>= 1.2, < 3)
|
86
|
-
faraday_middleware (0.12.0)
|
87
|
-
faraday (>= 0.7.4, < 1.0)
|
88
|
-
google-api-client (0.32.1)
|
89
|
-
addressable (~> 2.5, >= 2.5.1)
|
90
|
-
googleauth (>= 0.5, < 0.10.0)
|
91
|
-
httpclient (>= 2.8.1, < 3.0)
|
92
|
-
mini_mime (~> 1.0)
|
93
|
-
representable (~> 3.0)
|
94
|
-
retriable (>= 2.0, < 4.0)
|
95
|
-
signet (~> 0.10)
|
96
|
-
google-cloud-core (1.3.2)
|
97
|
-
google-cloud-env (~> 1.0)
|
98
|
-
google-cloud-env (1.2.1)
|
99
|
-
faraday (~> 0.11)
|
100
|
-
google-cloud-storage (1.21.1)
|
101
|
-
addressable (~> 2.5)
|
102
|
-
digest-crc (~> 0.4)
|
103
|
-
google-api-client (~> 0.26)
|
104
|
-
google-cloud-core (~> 1.2)
|
105
|
-
googleauth (>= 0.6.2, < 0.10.0)
|
106
|
-
mini_mime (~> 1.0)
|
107
|
-
googleauth (0.9.0)
|
108
|
-
faraday (~> 0.12)
|
109
|
-
jwt (>= 1.4, < 3.0)
|
110
|
-
memoist (~> 0.16)
|
111
|
-
multi_json (~> 1.11)
|
112
|
-
os (>= 0.9, < 2.0)
|
113
|
-
signet (~> 0.7)
|
114
|
-
hike (1.2.3)
|
115
|
-
httparty (0.15.5)
|
116
|
-
multi_xml (>= 0.5.2)
|
117
|
-
httpclient (2.8.3)
|
118
|
-
i18n (0.9.5)
|
119
|
-
concurrent-ruby (~> 1.0)
|
120
|
-
jmespath (1.3.1)
|
121
|
-
journey (1.0.4)
|
122
|
-
json (1.8.6)
|
123
|
-
jwt (2.3.0)
|
124
|
-
mail (2.5.5)
|
125
|
-
mime-types (~> 1.16)
|
126
|
-
treetop (~> 1.4.8)
|
127
|
-
marcel (1.0.2)
|
128
|
-
memoist (0.16.2)
|
129
|
-
mime-types (1.25.1)
|
130
|
-
mini_magick (4.8.0)
|
131
|
-
mini_mime (1.1.2)
|
132
|
-
mini_portile2 (2.2.0)
|
133
|
-
minitest (5.15.0)
|
134
|
-
multi_json (1.15.0)
|
135
|
-
multi_xml (0.6.0)
|
136
|
-
multipart-post (2.0.0)
|
137
|
-
nokogiri (1.8.0)
|
138
|
-
mini_portile2 (~> 2.2.0)
|
139
|
-
os (1.1.4)
|
140
|
-
parallel (1.11.2)
|
141
|
-
parser (2.4.0.0)
|
142
|
-
ast (~> 2.2)
|
143
|
-
polyglot (0.3.5)
|
144
|
-
power_assert (2.0.3)
|
145
|
-
powerpack (0.1.1)
|
146
|
-
public_suffix (4.0.7)
|
147
|
-
rack (1.4.7)
|
148
|
-
rack-cache (1.13.0)
|
149
|
-
rack (>= 0.4)
|
150
|
-
rack-protection (2.2.4)
|
151
|
-
rack
|
152
|
-
rack-ssl (1.3.4)
|
153
|
-
rack
|
154
|
-
rack-test (0.6.3)
|
155
|
-
rack (>= 1.0)
|
156
|
-
rails (3.2.22.5)
|
157
|
-
actionmailer (= 3.2.22.5)
|
158
|
-
actionpack (= 3.2.22.5)
|
159
|
-
activerecord (= 3.2.22.5)
|
160
|
-
activeresource (= 3.2.22.5)
|
161
|
-
activesupport (= 3.2.22.5)
|
162
|
-
bundler (~> 1.0)
|
163
|
-
railties (= 3.2.22.5)
|
164
|
-
railties (3.2.22.5)
|
165
|
-
actionpack (= 3.2.22.5)
|
166
|
-
activesupport (= 3.2.22.5)
|
167
|
-
rack-ssl (~> 1.3.2)
|
168
|
-
rake (>= 0.8.7)
|
169
|
-
rdoc (~> 3.4)
|
170
|
-
thor (>= 0.14.6, < 2.0)
|
171
|
-
rainbow (2.2.2)
|
172
|
-
rake
|
173
|
-
rake (12.0.0)
|
174
|
-
rdoc (3.12.2)
|
175
|
-
json (~> 1.4)
|
176
|
-
redis (4.4.0)
|
177
|
-
representable (3.0.4)
|
178
|
-
declarative (< 0.1.0)
|
179
|
-
declarative-option (< 0.2.0)
|
180
|
-
uber (< 0.2.0)
|
181
|
-
retriable (3.1.2)
|
182
|
-
rr (3.1.0)
|
183
|
-
rubocop (0.49.1)
|
184
|
-
parallel (~> 1.10)
|
185
|
-
parser (>= 2.3.3.1, < 3.0)
|
186
|
-
powerpack (~> 0.1)
|
187
|
-
rainbow (>= 1.99.1, < 3.0)
|
188
|
-
ruby-progressbar (~> 1.7)
|
189
|
-
unicode-display_width (~> 1.0, >= 1.0.1)
|
190
|
-
ruby-progressbar (1.8.1)
|
191
|
-
sidekiq (5.2.8)
|
192
|
-
connection_pool (~> 2.2, >= 2.2.2)
|
193
|
-
rack (< 2.1.0)
|
194
|
-
rack-protection (>= 1.5.0)
|
195
|
-
redis (>= 3.3.5, < 5)
|
196
|
-
signet (0.11.0)
|
197
|
-
addressable (~> 2.3)
|
198
|
-
faraday (~> 0.9)
|
199
|
-
jwt (>= 1.5, < 3.0)
|
200
|
-
multi_json (~> 1.10)
|
201
|
-
simplecov (0.17.1)
|
202
|
-
docile (~> 1.1)
|
203
|
-
json (>= 1.8, < 3)
|
204
|
-
simplecov-html (~> 0.10.0)
|
205
|
-
simplecov-html (0.10.2)
|
206
|
-
sprockets (2.2.3)
|
207
|
-
hike (~> 1.2)
|
208
|
-
multi_json (~> 1.0)
|
209
|
-
rack (~> 1.0)
|
210
|
-
tilt (~> 1.1, != 1.3.0)
|
211
|
-
sqlite3 (1.3.13)
|
212
|
-
strong_parameters (0.2.3)
|
213
|
-
actionpack (~> 3.0)
|
214
|
-
activemodel (~> 3.0)
|
215
|
-
activesupport (~> 3.0)
|
216
|
-
railties (~> 3.0)
|
217
|
-
test-unit (3.6.1)
|
218
|
-
power_assert
|
219
|
-
test-unit-activesupport (1.1.1)
|
220
|
-
activesupport
|
221
|
-
test-unit
|
222
|
-
test-unit-capybara (1.1.1)
|
223
|
-
capybara (>= 2.1.0)
|
224
|
-
json
|
225
|
-
test-unit (>= 2.5.3)
|
226
|
-
test-unit-notify (1.0.4)
|
227
|
-
test-unit (>= 2.4.9)
|
228
|
-
test-unit-rails (1.0.4)
|
229
|
-
rails
|
230
|
-
test-unit-activesupport (>= 1.0.2)
|
231
|
-
test-unit-capybara
|
232
|
-
test-unit-notify
|
233
|
-
test-unit-rr
|
234
|
-
test-unit-rr (1.0.5)
|
235
|
-
rr (>= 1.1.1)
|
236
|
-
test-unit (>= 2.5.2)
|
237
|
-
thor (1.2.2)
|
238
|
-
tilt (1.4.1)
|
239
|
-
treetop (1.4.15)
|
240
|
-
polyglot
|
241
|
-
polyglot (>= 0.3.1)
|
242
|
-
tzinfo (0.3.62)
|
243
|
-
uber (0.1.0)
|
244
|
-
unicode-display_width (1.3.0)
|
245
|
-
xpath (3.2.0)
|
246
|
-
nokogiri (~> 1.8)
|
247
|
-
|
248
|
-
PLATFORMS
|
249
|
-
ruby
|
250
|
-
|
251
|
-
DEPENDENCIES
|
252
|
-
activestorage_legacy!
|
253
|
-
aws-sdk (~> 2)
|
254
|
-
azure-core!
|
255
|
-
azure-storage
|
256
|
-
bundler (~> 1.15)
|
257
|
-
byebug
|
258
|
-
google-cloud-storage
|
259
|
-
httparty
|
260
|
-
mini_magick
|
261
|
-
minitest (~> 5.15)
|
262
|
-
rails (~> 3.2.22.4)
|
263
|
-
rake
|
264
|
-
rubocop
|
265
|
-
simplecov
|
266
|
-
sqlite3
|
267
|
-
test-unit (~> 3.6)
|
268
|
-
test-unit-rails (~> 1.0)
|
269
|
-
|
270
|
-
BUNDLED WITH
|
271
|
-
1.17.3
|