Mercurial > rsstweet
comparison app/controllers/tweets_controller.rb @ 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 | 32c8c150cd80 |
children | 59a4645fd24c |
comparison
equal
deleted
inserted
replaced
161:c2e9d3a36bde | 162:3ff631612493 |
---|---|
17 | 17 |
18 private | 18 private |
19 | 19 |
20 def validate_id | 20 def validate_id |
21 id = params[:id].split("/")[0] | 21 id = params[:id].split("/")[0] |
22 int_id = id.to_i | 22 if id.to_i == id |
23 if int_id.to_s == id | 23 params[:id] = id |
24 params[:id] = int_id | |
25 else | 24 else |
26 try_redirect | 25 try_redirect |
27 end | 26 end |
28 end | 27 end |
29 | 28 |