grip 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/grip.gemspec +1 -1
- data/lib/grip/has_attachment.rb +4 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.9
|
data/grip.gemspec
CHANGED
data/lib/grip/has_attachment.rb
CHANGED
@@ -54,7 +54,10 @@ module Grip
|
|
54
54
|
new_attachment.owner_type = self.class.to_s
|
55
55
|
new_attachment.file_name = File.basename(new_file.path)
|
56
56
|
new_attachment.file_size = File.size(new_file.path)
|
57
|
-
|
57
|
+
|
58
|
+
# ruby 1.9 mime type hack
|
59
|
+
new_attachment.content_type = MIME::Types.type_for(new_file.path)[0].content_type rescue MIME::Types.type_for(new_file.path)
|
60
|
+
|
58
61
|
new_attachment.file = new_file
|
59
62
|
new_attachment.variants = opts[:variants] || {}
|
60
63
|
new_attachment.save!
|