changeset 162:3ff631612493

Simplified id check. Now it's mostly string
author nanaya <me@nanaya.pro>
date Fri, 03 Aug 2018 02:03:21 +0900
parents c2e9d3a36bde
children ed73d92c7113
files app/controllers/tweets_controller.rb
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/tweets_controller.rb	Fri Aug 03 02:01:32 2018 +0900
+++ b/app/controllers/tweets_controller.rb	Fri Aug 03 02:03:21 2018 +0900
@@ -19,9 +19,8 @@
 
   def validate_id
     id = params[:id].split("/")[0]
-    int_id = id.to_i
-    if int_id.to_s == id
-      params[:id] = int_id
+    if id.to_i == id
+      params[:id] = id
     else
       try_redirect
     end