assemblymade/coderwall

View on GitHub
app/jobs/resize_tilt_shift_banner_job.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ResizeTiltShiftBannerJob
  include Sidekiq::Worker

  sidekiq_options queue: :user

  def perform(klass, id, column)
    image = klass.constantize.find(id)
    unless image.nil?
      image.send(:"#{column}").resize_to_fit(500, 375)
      image.send(:"#{column}").apply_tilt_shift
      image.save!
    end
  end
end