Module: CarrierWave::Uploader::Callbacks

Defined in:
lib/carrierwave/uploader/callbacks.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#with_callbacks(kind, *args) ⇒ Object



11
12
13
14
15
# File 'lib/carrierwave/uploader/callbacks.rb', line 11

def with_callbacks(kind, *args)
  self.class._before_callbacks_for(kind).each { |callback| self.send(callback, *args) }
  yield
  self.class._after_callbacks_for(kind).each { |callback| self.send(callback, *args) }
end