osem-fcy/db
Andrew Kvalheim 079f609603
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'
2021-03-06 20:08:15 +01:00
..
migrate Fix migration that fails on conferences without pictures 2021-03-06 20:08:15 +01:00
schema.rb Remove travel schedule from registration 2021-03-06 04:09:02 +01:00
seeds.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00