Module: CarrierWave::Uploader::Processing

Extended by:
ActiveSupport::Concern
Includes:
Callbacks
Included in:
Base
Defined in:
lib/carrierwave/uploader/processing.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Callbacks

#with_callbacks

Instance Method Details

#process!(new_file = nil) ⇒ Object

Apply all process callbacks added through CarrierWave.process



79
80
81
82
83
84
85
86
87
88
# File 'lib/carrierwave/uploader/processing.rb', line 79

def process!(new_file=nil)
  if enable_processing
    self.class.processors.each do |method, args, condition|
      if(condition)
        next if !(condition.respond_to?(:call) ? condition.call(self, :args => args, :method => method, :file => new_file) : self.send(condition, new_file))
      end
      self.send(method, *args)
    end
  end
end