changeset 247:9aa67da381b0

Make sure to split a string.
author edogawaconan <me@myconan.net>
date Thu, 10 Oct 2013 04:25:07 +0000
parents 8ab17063419f
children 9d6f13168d25
files app/models/paste.rb
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/models/paste.rb	Mon Oct 07 04:18:17 2013 +0000
+++ b/app/models/paste.rb	Thu Oct 10 04:25:07 2013 +0000
@@ -13,7 +13,7 @@
   end
 
   def self.safe_find(raw_id)
-    id, secret = raw_id.split("-")
+    id, secret = raw_id.to_s.split("-")
     return unless id.to_i.to_s == id
     begin
       self.where(secret: secret).find(id)