# encoding: utf-8classAvatarUploader<CarrierWave::Uploader::Basestorage:fileafter:store,:reset_events_cachedefstore_dir"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"enddefimage?img_ext=%w(png jpg jpeg gif bmp tiff)iffile.respond_to?(:extension)img_ext.include?(file.extension.downcase)else# Not all CarrierWave storages respond to :extensionext=file.path.split('.').last.downcaseimg_ext.include?(ext)endrescuefalseenddeffile_storage?self.class.storage==CarrierWave::Storage::Fileenddefreset_events_cache(file)model.reset_events_cacheifmodel.is_a?(User)endend