Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

CarrierWave::Uploader::Store#filename should proxy to us. #28

Open
1 task
richardkmichael opened this issue Feb 8, 2013 · 0 comments
Open
1 task
Milestone

Comments

@richardkmichael
Copy link
Owner

There appears to be a bug in CarrierWave::Uploader::Store#filename -> @filename is nil, e.g. @filename is not being set by the cache code. Neither cache! nor retrieve_from_cache! are being called.

  • Review CarrierWave's Uploader spec re: Store#filename()

Workaround by adding a filename() method to your uploader:

class FooUploader
  def filename
    self.file.filename
  end
end

CarrierWave::Uploader should proxy the #filename() message to the file, as it does for other convenience methods. E.g. https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/uploader/store.rb#L27 could do:

  @filename ||= file.filename if file.respond_to?(:filename)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant