Skip to content

Commit

Permalink
#processed? is now private
Browse files Browse the repository at this point in the history
  • Loading branch information
miharekar committed Sep 26, 2023
1 parent d82f710 commit ddd5266
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ def show_premium_banner?

def public_image_url(image)
if image.respond_to?(:variation)
if image.processed?
blob = image.image.blob
else
blob = image.image&.blob
if blob.blank?
ProcessImageJob.perform_later(image.blob, image.variation.transformations)
blob = image.blob
end
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/process_image_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ProcessImageJob < ApplicationJob
queue_as :default

def perform(blob, options)
blob.variant(options).process
blob.variant(options).processed
rescue Vips::Error => e
RorVsWild.record_error(e, blob_id: blob.id, attachments: blob.attachments.map { |a| a.record.to_global_id.to_s })
blob.attachments.each { |a| a.purge_later }
Expand Down
2 changes: 1 addition & 1 deletion app/views/changes/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta name="twitter:card" content="summary_large_image">
<meta property="og:title" content="<%= @change.title %>">
<% if @change.image.attached? %>
<meta property="og:image" content="<%= public_image_url(@change.image.variant(:social)) %>">
<meta property="og:image" content="<%= public_image_url(@change.image.variant(:social)).html_safe %>">
<meta property="og:url" content="https://visualizer.coffee/changes/<%= @change.slug %>">
<meta property="og:description" content="<%= @change.excerpt %>">
<% end %>
Expand Down

0 comments on commit ddd5266

Please sign in to comment.