Class: CarrierWave::Storage::File

Inherits:
Object
  • Object
show all
Defined in:
lib/has_moderated/carrier_wave_patches.rb

Instance Method Summary collapse

Instance Method Details

#retrieve_with_moderation_preview!(identifier) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/has_moderated/carrier_wave_patches.rb', line 23

def retrieve_with_moderation_preview!(identifier)
  tmp_path = Pathname.new(Rails.public_path).join(@uploader.class.store_dir).join("tmp").to_s

  if identifier.try(:start_with?, tmp_path)
    ::CarrierWave::HasModeratedTempFile.new(identifier)
  else
    retrieve_without_moderation_preview!(identifier)
  end
end