osem-fcy/db
Andrew Kvalheim 63aa240e65 Fix migration that fails on conferences without pictures
CarrierWave documentation:

> Note: `recreate_versions!` will throw an exception on records without
> an image. To avoid this, scope the records to those with images or
> check if an image exists within the block.

Resolves #1976:

    NoMethodError: undefined method `read' for nil:NilClass
    …/carrierwave-1.3.1/lib/carrierwave/uploader/cache.rb:81:in `sanitized_file'
    …/carrierwave-1.3.1/lib/carrierwave/uploader/cache.rb:118:in `cache!'
    …/carrierwave-1.3.1/lib/carrierwave/uploader/versions.rb:234:in `recreate_versions!'
    db/migrate/20171130172334_rebuild_conference_pictures.rb:4:in `block in up'
2020-05-12 07:43:58 -07:00
..
migrate Fix migration that fails on conferences without pictures 2020-05-12 07:43:58 -07:00
schema.rb Update schema.rb formatting 2019-07-21 15:11:53 +05:30
seeds.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00