diff app/models/paste.rb @ 247:9aa67da381b0

Make sure to split a string.
author edogawaconan <me@myconan.net>
date Thu, 10 Oct 2013 04:25:07 +0000
parents 1c750d3cde1b
children a894d7696b7e
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)