module Shrine::Plugins::KeepFiles

  1. lib/shrine/plugins/keep_files.rb

Documentation lives in doc/plugins/keep_files.md on GitHub.

Methods

Public Class

  1. configure

Public Class methods

configure (uploader, opts = {})
[show source]
   # File lib/shrine/plugins/keep_files.rb
 9 def self.configure(uploader, opts = {})
10   keep_files = (uploader.opts[:keep_files] ||= [])
11   opts[:destroyed] ? keep_files << :destroyed : keep_files.delete(:destroyed) if opts.key?(:destroyed)
12   opts[:replaced] ? keep_files << :replaced : keep_files.delete(:replaced) if opts.key?(:replaced)
13 end