diff app/models/paste.rb @ 230:1c750d3cde1b

Correct way to test is_private flag.
author Edho Arief <edho@myconan.net>
date Wed, 15 May 2013 14:31:20 +0900
parents 388504e43bcf
children 9aa67da381b0
line wrap: on
line diff
--- a/app/models/paste.rb	Wed May 15 14:10:35 2013 +0900
+++ b/app/models/paste.rb	Wed May 15 14:31:20 2013 +0900
@@ -35,7 +35,11 @@
   end
 
   def set_paste_secret
-    self.secret = SecureRandom.hex(4) if self.is_private
+    self.secret = SecureRandom.hex(4) if self.is_private?
+  end
+
+  def is_private?
+    self.is_private == "1"
   end
 
   def convert_newlines