Skip to main content

Shrine 3.4.0

  • Passing attacher options to Shrine.Attachment method now works on Ruby 3.0.

  • Defining validation errors as an array of I18n key and options in activerecord plugin now works on Ruby 3.0.

  • The :fastimage MIME type analyzer now correctly detects SVGs as image/svg+html in the determine_mime_type plugin.

  • The Shrine::Attacher#read method provided by the entity plugin is now public. This is consistent with Shrine::Attacher#write from model plugin being public as well.

  • The Shrine::Attacher#reload method now resets attachment's dirty state. This means that for a model whose Attacher#changed? returns true, calling #reload on the model will make Attacher#changed? return false. This was the behaviour before Shrine 3.3.0.

    # before
    model.file_attacher.changed? #=> true
    model.reload
    model.file_attacher.changed? #=> true
    
    # after
    model.file_attacher.changed? #=> true
    model.reload
    model.file_attacher.changed? #=> false
  • Calling #reload on the model will not initialize a Shrine::Attacher instance anymore if one hasn't previously been initialized.