carrierwave 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of carrierwave might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d156dd7cde36460576c176937cbe38967f0f7ed9f6d3e6fe602e4adc3fedee0
|
4
|
+
data.tar.gz: 4d09e2dae61f271be839edabe60811faa60beec6b699a391ab8f3f5b2a453f04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c58ec99cca0ae6fa0068f93b2271f72581406a9a823b03a47f4cad744a758b33460f28de299ff7690022efb97dd277cd04ce5e87f0fc5a06c5cadbb42ef11f36
|
7
|
+
data.tar.gz: 7e588a03b01df29c687c5a418757d4a1d24e0bd22eeff21fd2409206020532f7536d31d6b69bd34c49b1928bde5cac72cea0bec7e23be014deef4fbeb59c7c8c
|
@@ -33,9 +33,9 @@ module CarrierWave
|
|
33
33
|
|
34
34
|
def original_filename
|
35
35
|
filename = filename_from_header || filename_from_uri
|
36
|
-
|
37
|
-
unless File.extname(filename).present? ||
|
38
|
-
extension =
|
36
|
+
extensions = Marcel::Magic.new(content_type).extensions
|
37
|
+
unless File.extname(filename).present? || extensions.blank?
|
38
|
+
extension = extensions.first
|
39
39
|
filename = "#{filename}.#{extension}"
|
40
40
|
end
|
41
41
|
filename
|
@@ -24,11 +24,16 @@ module CarrierWave
|
|
24
24
|
|
25
25
|
after_save :"store_#{column}!"
|
26
26
|
before_save :"write_#{column}_identifier"
|
27
|
+
if ::ActiveRecord.try(:run_after_transaction_callbacks_in_order_defined)
|
28
|
+
after_commit :"remove_previously_stored_#{column}", :on => :update
|
29
|
+
after_commit :"reset_previous_changes_for_#{column}"
|
30
|
+
after_commit :"mark_remove_#{column}_false", :on => :update
|
31
|
+
else
|
32
|
+
after_commit :"mark_remove_#{column}_false", :on => :update
|
33
|
+
after_commit :"reset_previous_changes_for_#{column}"
|
34
|
+
after_commit :"remove_previously_stored_#{column}", :on => :update
|
35
|
+
end
|
27
36
|
after_commit :"remove_#{column}!", :on => :destroy
|
28
|
-
after_commit :"mark_remove_#{column}_false", :on => :update
|
29
|
-
|
30
|
-
after_commit :"reset_previous_changes_for_#{column}"
|
31
|
-
after_commit :"remove_previously_stored_#{column}", :on => :update
|
32
37
|
after_rollback :"remove_rolled_back_#{column}"
|
33
38
|
|
34
39
|
mod = Module.new
|
@@ -40,10 +40,10 @@ module CarrierWave
|
|
40
40
|
#
|
41
41
|
# === Returns
|
42
42
|
#
|
43
|
-
# [String] a temporary_identifier, by default
|
43
|
+
# [String] a temporary_identifier, by default the value of #cache_name is used
|
44
44
|
#
|
45
45
|
def temporary_identifier
|
46
|
-
|
46
|
+
cache_name || @identifier
|
47
47
|
end
|
48
48
|
|
49
49
|
##
|
@@ -279,7 +279,7 @@ module CarrierWave
|
|
279
279
|
# that are the source of another version.
|
280
280
|
|
281
281
|
self.cache_id = CarrierWave.generate_cache_id
|
282
|
-
derived_versions.
|
282
|
+
derived_versions.each_value do |v|
|
283
283
|
v.cache!(file) if names.empty? || !(v.descendant_version_names & names).empty?
|
284
284
|
end
|
285
285
|
active_versions.each do |name, v|
|
@@ -308,13 +308,13 @@ module CarrierWave
|
|
308
308
|
def derived_versions
|
309
309
|
active_versions.reject do |name, v|
|
310
310
|
v.class.version_options[:from_version]
|
311
|
-
end.
|
311
|
+
end.merge(active_sibling_versions.select do |name, v|
|
312
312
|
v.class.version_options[:from_version] == self.class.version_names.last
|
313
|
-
end
|
313
|
+
end)
|
314
314
|
end
|
315
315
|
|
316
316
|
def active_sibling_versions
|
317
|
-
parent_version&.active_versions ||
|
317
|
+
parent_version&.active_versions || {}
|
318
318
|
end
|
319
319
|
|
320
320
|
def full_filename(for_file)
|
@@ -326,23 +326,23 @@ module CarrierWave
|
|
326
326
|
end
|
327
327
|
|
328
328
|
def cache_versions!(new_file)
|
329
|
-
derived_versions.
|
329
|
+
derived_versions.each_value { |v| v.cache!(new_file) }
|
330
330
|
end
|
331
331
|
|
332
332
|
def store_versions!(new_file)
|
333
|
-
active_versions.
|
333
|
+
active_versions.each_value { |v| v.store!(new_file) }
|
334
334
|
end
|
335
335
|
|
336
336
|
def remove_versions!
|
337
|
-
versions.
|
337
|
+
versions.each_value { |v| v.remove! }
|
338
338
|
end
|
339
339
|
|
340
340
|
def retrieve_versions_from_cache!(cache_name)
|
341
|
-
active_versions.
|
341
|
+
active_versions.each_value { |v| v.retrieve_from_cache!(cache_name) }
|
342
342
|
end
|
343
343
|
|
344
344
|
def retrieve_versions_from_store!(identifier)
|
345
|
-
active_versions.
|
345
|
+
active_versions.each_value { |v| v.retrieve_from_store!(identifier) }
|
346
346
|
end
|
347
347
|
|
348
348
|
end # Versions
|
data/lib/carrierwave/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: csv
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: cucumber
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|