Mercurial > zeropaste
diff app/controllers/pastes_controller.rb @ 151:db5164ff73a9
Always fill in @paste.ip when creating new one.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Mon, 26 Nov 2012 21:53:12 +0700 |
parents | 0f206bd4924f |
children | 500c09718fd7 |
line wrap: on
line diff
--- a/app/controllers/pastes_controller.rb Mon Nov 26 21:52:43 2012 +0700 +++ b/app/controllers/pastes_controller.rb Mon Nov 26 21:53:12 2012 +0700 @@ -36,6 +36,7 @@ # POST /pastes.txt def create @paste = Paste.new + @paste.ip = request.remote_ip if params[:paste] if params[:paste][:paste_gzip_base64] # 1. decode from base64 @@ -45,7 +46,6 @@ end unless params[:paste][:paste].blank? @paste.paste = params[:paste][:paste] - @paste.ip = request.remote_ip end end