Mercurial > zeropaste
comparison app/controllers/pastes_controller.rb @ 225:9998d8b6c524
Wrong usage of .delete
| author | Edho Arief <edho@myconan.net> | 
|---|---|
| date | Mon, 13 May 2013 13:19:13 +0900 | 
| parents | 186b4674bcbe | 
| children | fb9909885d63 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 224:6e9718a1ee11 | 225:9998d8b6c524 | 
|---|---|
| 33 def create | 33 def create | 
| 34 if params[:paste] && params[:paste][:paste_gzip_base64] | 34 if params[:paste] && params[:paste][:paste_gzip_base64] | 
| 35 # 1. decode from base64 | 35 # 1. decode from base64 | 
| 36 # 2. create StringIO from decoded string | 36 # 2. create StringIO from decoded string | 
| 37 # 3. unzip and read the stream | 37 # 3. unzip and read the stream | 
| 38 params[:paste][:paste] = Zlib::GzipReader.new(StringIO.new(Base64.decode64(params[:paste][:paste_gzip_base64].delete))).read | 38 params[:paste][:paste] = Zlib::GzipReader.new(StringIO.new(Base64.decode64(params[:paste].delete(:paste_gzip_base64)))).read | 
| 39 end | 39 end | 
| 40 @paste = Paste.new(paste_params.merge(ip: request.remote_ip)) | 40 @paste = Paste.new(paste_params.merge(ip: request.remote_ip)) | 
| 41 | 41 | 
| 42 begin | 42 begin | 
| 43 respond_to do |format| | 43 respond_to do |format| | 
