Skip to content

Instantly share code, notes, and snippets.

@benhutton
benhutton / asdf.rb
Last active December 20, 2018 15:51
bad = the_lantern.library_entries.to_a.select { |le| !le.promo_image.file.exists? }
bad.each do |le|
next unless le.promo_image.present?
good_url = le.promo_image_url.sub('resource_library/library_entry', 'blog/blog_entry').sub('//', 'https://')
puts good_url
le.update_column(:promo_image, nil)
le = RL::LibraryEntry.find(le.id)
le.remote_promo_image_url = good_url