Skip to content

Commit

Permalink
Fix ActiveStorage type detection for email files
Browse files Browse the repository at this point in the history
Fixes #555
  • Loading branch information
const-cloudinary committed Aug 18, 2024
1 parent a634428 commit ab52429
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/active_storage/service/cloudinary_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def content_type_to_resource_type(content_type)
case type
when 'video', 'audio'
'video'
when 'text'
when 'text', 'message'
'raw'
when 'application'
case subtype
Expand Down
2 changes: 1 addition & 1 deletion spec/active_storage/service/cloudinary_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

it "should set raw resource_type for raw formats" do
key = SecureRandom.base58(24)
types = %w[text/* application/*]
types = %w[text/* application/* message/*]

types.each do |content_type|
url = @service.url_for_direct_upload(key, content_type: content_type)
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SUFFIX = ENV['TRAVIS_JOB_ID'] || rand(999999999).to_s

require 'bundler/setup'
require 'rspec'
require 'rspec/retry'
require 'rexml/parsers/ultralightparser'
Expand Down

0 comments on commit ab52429

Please sign in to comment.