Skip to content

Commit

Permalink
feat: carrierware 升级到 3
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Dec 7, 2023
1 parent 5470905 commit ef46f42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ gem 'friendly_id', '~> 5.5.1'
## 数据分页
gem 'kaminari', '~> 1.2.2'
## 文件上传
gem 'carrierwave', '~> 2.2.3'
gem 'carrierwave', '~> 3.0.4'
gem 'webp-ffi', '~> 0.4.0'

# Helper
Expand Down
19 changes: 9 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ GEM
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.1)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
android_parser (2.6.0)
Expand Down Expand Up @@ -117,13 +117,12 @@ GEM
bootsnap (1.17.0)
msgpack (~> 1.2)
builder (3.2.4)
carrierwave (2.2.3)
activemodel (>= 5.0.0)
activesupport (>= 5.0.0)
carrierwave (3.0.5)
activemodel (>= 6.0.0)
activesupport (>= 6.0.0)
addressable (~> 2.6)
image_processing (~> 1.1)
marcel (~> 1.0.0)
mini_mime (>= 0.1.3)
ssrf_filter (~> 1.0)
case_transform (0.2)
activesupport
Expand Down Expand Up @@ -165,7 +164,7 @@ GEM
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
faraday-net_http (3.0.2)
ffi (1.15.5)
ffi (1.16.3)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
Expand Down Expand Up @@ -361,7 +360,7 @@ GEM
pry (>= 0.12.0)
psych (5.1.1.1)
stringio
public_suffix (5.0.1)
public_suffix (5.0.4)
puma (6.4.0)
nio4r (~> 2.0)
pundit (2.3.1)
Expand Down Expand Up @@ -466,7 +465,7 @@ GEM
rubocop (>= 1.33.0, < 2.0)
ruby-macho (3.0.0)
ruby-progressbar (1.11.0)
ruby-vips (2.1.4)
ruby-vips (2.2.0)
ffi (~> 1.12)
ruby2_keywords (0.0.5)
rubyntlm (0.6.3)
Expand Down Expand Up @@ -510,7 +509,7 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
ssrf_filter (1.1.1)
ssrf_filter (1.1.2)
stimulus-rails (1.3.0)
railties (>= 6.0.0)
stringio (3.1.0)
Expand Down Expand Up @@ -579,7 +578,7 @@ DEPENDENCIES
better_errors
binding_of_caller
bootsnap (>= 1.4.7)
carrierwave (~> 2.2.3)
carrierwave (~> 3.0.4)
cssbundling-rails (~> 1.3)
debug (~> 1.8.0)
devise (~> 4.9.3)
Expand Down
8 changes: 0 additions & 8 deletions app/uploaders/app_icon_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ def store_dir
"#{base_store_dir}/apps/a#{model.app.id}/r#{model.id}/icons"
end

# @param [ActionDispatch::Http::UploadedFile] file
def filename
return super unless not_png?(file)

filename = File.basename(file.path)
"#{filename}.png"
end

def content_type_allowlist
/image\//
end
Expand Down

0 comments on commit ef46f42

Please sign in to comment.