23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# 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)
basename = begin
uploader.send(:full_filename, ::File::basename(identifier))
rescue
::File::basename(identifier)
end
path = ::File::join([::File::dirname(identifier),
basename])
::CarrierWave::HasModeratedTempFile.new(path)
else
retrieve_without_moderation_preview!(identifier)
end
end
|