class Wco::PhotosController
def destroy
def destroy authorize! :destroy, Wco::Photo if params[:id] @photos = [ Wco::Photo.unscoped.find( params[:id] ) ] elsif params[:ids] @photos = Wco::Photo.where( :id.in => params[:ids] ) end outs = [] @photos.map do |photo| photo.gallery.touch if photo.gallery outs.push photo.delete end flash_notice "Outcomes: #{outs}" redirect_to request.referrer || root_path end