Class: CarrierWave::Mounter

Inherits:
Object
  • Object
show all
Defined in:
lib/custom_fields/extensions/carrierwave.rb

Instance Method Summary collapse

Instance Method Details

#remove_previous_with_localization(before = nil, after = nil) ⇒ Object Also known as: remove_previous



29
30
31
32
33
34
35
36
37
38
# File 'lib/custom_fields/extensions/carrierwave.rb', line 29

def remove_previous_with_localization(before=nil, after=nil)
  _after = after

  if after && after.first.is_a?(Hash)
    locale = ::Mongoid::Fields::I18n.locale.to_s
    _after = [after.first[locale]]
  end

  remove_previous_without_localization(before, _after)
end