module Shrine::Plugins::DefaultStorage::AttacherMethods

  1. lib/shrine/plugins/default_storage.rb

Methods

Public Class

  1. new

Public Class methods

new (record, name, **options)
[show source]
# File lib/shrine/plugins/default_storage.rb, line 21
def initialize(record, name, **options)
  if cache = shrine_class.opts[:default_storage_cache]
    cache = cache.call(record, name) if cache.respond_to?(:call)
    options[:cache] = cache
  end

  if store = shrine_class.opts[:default_storage_store]
    store = store.call(record, name) if store.respond_to?(:call)
    options[:store] = store
  end

  super
end