From d6610829f8c58d0aa769d8b664befb0a38186d6f Mon Sep 17 00:00:00 2001 From: Yuki Date: Wed, 26 Aug 2015 01:03:57 +0530 Subject: [PATCH] Badumdum --- app/models/theme.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/theme.rb b/app/models/theme.rb index ffbaa745..39fd7371 100644 --- a/app/models/theme.rb +++ b/app/models/theme.rb @@ -15,8 +15,12 @@ class Theme < ActiveRecord::Base greater_than_or_equal_to: 0, less_than_or_equal_to: 0xFFFFFF, allow_nil: true, only_integer: true - has_attached_file :css, use_timestamp: false - validates_attachment_content_type :css, content_type: 'text/x-c' + has_attached_file :css, use_timestamp: false, s3_metadata: { + content_type: 'text/stylesheet' + }, fog_file: { + content_type: 'text/stylesheet' + } + validates_attachment_content_type :css, content_type: /text\/(x-c|stylesheet)/ before_save do self.css = nil @@ -27,7 +31,7 @@ class Theme < ActiveRecord::Base attr_accessor :original_filename, :content_type } - style.content_type = 'text/x-c' + style.content_type = 'text/stylesheet' style.original_filename = 'theme.css' self.css = style