carrierwave 3.0.0.rc → 3.0.1
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 +4 -4
- data/README.md +1 -1
- data/lib/carrierwave/mounter.rb +1 -1
- data/lib/carrierwave/orm/activerecord.rb +2 -0
- data/lib/carrierwave/uploader/store.rb +3 -2
- data/lib/carrierwave/uploader/versions.rb +13 -0
- data/lib/carrierwave/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93ce71b0513b78b021bb85c121625135145ea8b78fc21bb64542e9114220d6cf
|
4
|
+
data.tar.gz: cfa74c58a128998a51b9d50d1f1f5d44ca95aeeb1847ff860fc9e55aedc33f61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 320adb08f7b9e280f43daa2663acd22bbe7bfc26a03461210a888e593136fd65c641f2aae3d332091ab4c59704cec6b9293864f85e7eb676ebebd06648c1b943
|
7
|
+
data.tar.gz: 140d651ba46ecda9e0e9209e01731e02782d3e4dc113e6e0b042faa64b3277aace8ac1f69a9f626bf0e083f4b60b5b9665612ae66b481c1f96b0ef074961d7cc
|
data/README.md
CHANGED
data/lib/carrierwave/mounter.rb
CHANGED
@@ -202,7 +202,7 @@ module CarrierWave
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def remove_added
|
205
|
-
current_paths = (@removed_uploaders +
|
205
|
+
current_paths = (@removed_uploaders + uploaders.select(&:staged)).map(&:path)
|
206
206
|
@added_uploaders
|
207
207
|
.reject {|uploader| current_paths.include?(uploader.path) }
|
208
208
|
.each { |uploader| uploader.remove! }
|
@@ -44,6 +44,8 @@ module CarrierWave
|
|
44
44
|
def initialize_dup(other)
|
45
45
|
old_uploaders = _mounter(:"#{column}").uploaders
|
46
46
|
@_mounters[:"#{column}"] = nil
|
47
|
+
# The attribute needs to be cleared to prevent it from picked up as identifier
|
48
|
+
write_attribute(:"#{column}", nil)
|
47
49
|
super
|
48
50
|
_mounter(:"#{column}").cache(old_uploaders)
|
49
51
|
end
|
@@ -43,11 +43,12 @@ module CarrierWave
|
|
43
43
|
#
|
44
44
|
def deduplicated_filename
|
45
45
|
return unless filename
|
46
|
+
return filename unless @deduplication_index
|
46
47
|
|
47
48
|
parts = filename.split('.')
|
48
49
|
basename = parts.shift
|
49
50
|
basename.sub!(/ ?\(\d+\)\z/, '')
|
50
|
-
([basename.to_s + (@deduplication_index ? "(#{@deduplication_index})" : '')] + parts).join('.')
|
51
|
+
([basename.to_s + (@deduplication_index > 1 ? "(#{@deduplication_index})" : '')] + parts).join('.')
|
51
52
|
end
|
52
53
|
|
53
54
|
##
|
@@ -120,7 +121,7 @@ module CarrierWave
|
|
120
121
|
@deduplication_index = nil
|
121
122
|
return unless current_paths.include?(store_path)
|
122
123
|
|
123
|
-
(
|
124
|
+
(1..current_paths.size + 1).each do |i|
|
124
125
|
@deduplication_index = i
|
125
126
|
break unless current_paths.include?(store_path)
|
126
127
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "active_support/core_ext/object/deep_dup"
|
2
|
+
|
1
3
|
module CarrierWave
|
2
4
|
module Uploader
|
3
5
|
module Versions
|
@@ -25,6 +27,17 @@ module CarrierWave
|
|
25
27
|
@klass.processors = []
|
26
28
|
@klass.version_options = @options
|
27
29
|
@klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
30
|
+
# Define the enable_processing method for versions so they get the
|
31
|
+
# value from the parent class unless explicitly overwritten
|
32
|
+
def self.enable_processing(value=nil)
|
33
|
+
self.enable_processing = value if value
|
34
|
+
if defined?(@enable_processing) && !@enable_processing.nil?
|
35
|
+
@enable_processing
|
36
|
+
else
|
37
|
+
superclass.enable_processing
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
28
41
|
# Regardless of what is set in the parent uploader, do not enforce the
|
29
42
|
# move_to_cache config option on versions because it moves the original
|
30
43
|
# file to the version's target file.
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -396,9 +396,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
396
396
|
version: 2.5.0
|
397
397
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
398
398
|
requirements:
|
399
|
-
- - "
|
399
|
+
- - ">="
|
400
400
|
- !ruby/object:Gem::Version
|
401
|
-
version:
|
401
|
+
version: '0'
|
402
402
|
requirements: []
|
403
403
|
rubygems_version: 3.3.7
|
404
404
|
signing_key:
|