Module: Shrine::Plugins::Derivatives::FileMethods

Defined in:
lib/shrine/plugins/derivatives.rb

Instance Method Summary collapse

Instance Method Details

#[](*keys) ⇒ Object


611
612
613
614
615
616
617
# File 'lib/shrine/plugins/derivatives.rb', line 611

def [](*keys)
  if keys.any? { |key| key.is_a?(Symbol) }
    fail Error, "Shrine::UploadedFile#[] doesn't accept symbol metadata names. Did you happen to call `record.attachment[:derivative_name]` when you meant to call `record.attachment(:derivative_name)`?"
  else
    super
  end
end