comparison app/models/paste.rb @ 483:02d043b1967d

Accept file upload instead of binary gzip parameter
author nanaya <me@nanaya.pro>
date Sun, 28 Nov 2021 19:54:08 +0900
parents f11862e58af4
children 84ca55a0568e
comparison
equal deleted inserted replaced
482:403f71d22b7b 483:02d043b1967d
34 34
35 [created, paste, fresh] 35 [created, paste, fresh]
36 end 36 end
37 37
38 def paste_gzip=(paste) 38 def paste_gzip=(paste)
39 self.paste = ActiveSupport::Gzip.decompress paste 39 self.paste = ActiveSupport::Gzip.decompress paste.read
40 end 40 end
41 41
42 def paste_gzip_base64=(paste) 42 def paste_gzip_base64=(paste)
43 self.paste_gzip = Base64.decode64(paste) 43 self.paste_gzip = Base64.decode64(paste)
44 end 44 end