diff app/models/paste.rb @ 316:61f7f258a6fb

Move from-gzip paste parsing to model.
author edogawaconan <me@myconan.net>
date Sat, 05 Apr 2014 23:23:25 +0900
parents d68cb68da802
children 96631607785f
line wrap: on
line diff
--- a/app/models/paste.rb	Sat Apr 05 23:20:32 2014 +0900
+++ b/app/models/paste.rb	Sat Apr 05 23:23:25 2014 +0900
@@ -22,6 +22,14 @@
     end
   end
 
+  def paste_gzip=(paste)
+    self.paste = ActiveSupport::Gzip.decompress paste
+  end
+
+  def paste_gzip_base64=(paste)
+    self.paste_gzip = Base64.decode64(paste)
+  end
+
   def safe_destroy(param_key)
     if key == param_key
       destroy