Rails controller method to show an optionally scaled image using MiniMagick
Rubocop Report

Conventions

Prefer key? over has_key? (PreferredHashMethods).


if params.has_key?(:thumbnail)



if params.key?(:thumbnail)




Prefer single quoted over double quoted string literals if you don't need interpolation or special symbols (StringLiterals).


image.resize("50x60")



image.resize('50x60')




Complexity


  If block in a separate, private method maybe?


The AbcSize complexity of your method is too high. [19.65/15] So your suggestion to put the following code in a private method, is justified.


 document = identification_document.id_document
 image = MiniMagick::Image.read(document.file.read)
 image.resize("50x60")
 scaled_image_bytes = image.to_blob





Readability

Keep line sizes below 80 characters:


send_data(identification_document.id_document.file.read, filename: identification_document.file_name)