mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 11:44:02 +00:00
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'
This commit is contained in:
parent
2051540693
commit
079f609603
1 changed files with 1 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class RebuildConferencePictures < ActiveRecord::Migration
|
||||
def up
|
||||
Conference.all.each do |conference|
|
||||
Conference.where.not(picture: nil).each do |conference|
|
||||
conference.picture.recreate_versions!
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue