Fix remote convertible media attachments not being saved (#13032)
Because the file name was set after loading the file, Paperclip was flagging the differing file extension as content type spoofing Fix #12938
This commit is contained in:
		
							parent
							
								
									9c2d10cd0c
								
							
						
					
					
						commit
						d0fe0d348b
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -36,8 +36,8 @@ module Remotable | ||||||
| 
 | 
 | ||||||
|             basename = SecureRandom.hex(8) |             basename = SecureRandom.hex(8) | ||||||
| 
 | 
 | ||||||
|             send("#{attachment_name}=", StringIO.new(response.body_with_limit(limit))) |  | ||||||
|             send("#{attachment_name}_file_name=", basename + extname) |             send("#{attachment_name}_file_name=", basename + extname) | ||||||
|  |             send("#{attachment_name}=", StringIO.new(response.body_with_limit(limit))) | ||||||
| 
 | 
 | ||||||
|             self[attribute_name] = url if has_attribute?(attribute_name) |             self[attribute_name] = url if has_attribute?(attribute_name) | ||||||
|           end |           end | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue