Skip to content

Commit

Permalink
Merge pull request rails#51285 from tsvallender/ensure_image_processi…
Browse files Browse the repository at this point in the history
…ng_installed_trix

Ensure image_processing is installed with Trix
  • Loading branch information
rafaelfranca authored May 2, 2024
2 parents 087260d + 259b08b commit 113ca9e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ def create_actiontext_files
def enable_image_processing_gem
if (gemfile_path = Pathname(destination_root).join("Gemfile")).exist?
say "Ensure image_processing gem has been enabled so image uploads will work (remember to bundle!)"
uncomment_lines gemfile_path, /gem "image_processing"/
image_processing_regex = /gem ["']image_processing["']/
if File.readlines(gemfile_path).grep(image_processing_regex).any?
uncomment_lines gemfile_path, image_processing_regex
else
run "bundle add --skip-install image_processing"
end
end
end

Expand Down

0 comments on commit 113ca9e

Please sign in to comment.