Last active
December 20, 2018 15:51
-
-
Save benhutton/1b3077272e1e331544e620f60d11e63b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
puts 'saving...' | |
le.save | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment