lib/backgrounder/delay_storage.rb in carrierwave_backgrounder-0.0.5 vs lib/backgrounder/delay_storage.rb in carrierwave_backgrounder-0.0.6

- old
+ new

@@ -1,15 +1,24 @@ module CarrierWave module Backgrounder module DelayStorage + + ## + #Intercept carrierwave#cache_versions! so we can process versions later. def cache_versions!(new_file) super(new_file) if proceed_with_versioning? end + def process!(new_file=nil) + super(new_file) if proceed_with_versioning? + end + + private + def proceed_with_versioning? !model.respond_to?(:"process_#{mounted_as}_upload") || model.send(:"process_#{mounted_as}_upload") end end # DelayStorage end # Backgrounder -end # CarrierWave \ No newline at end of file +end # CarrierWave