lib/active_metadata/persistence/attachment.rb in active_metadata-0.8.3.1 vs lib/active_metadata/persistence/attachment.rb in active_metadata-0.8.4
- old
+ new
@@ -5,9 +5,10 @@
end
module InstanceMethods
def save_attachment_for(field, file, starred=false, group=nil)
+ file.content_type = MIME::Types.type_for(file.original_filename)[0]
attachment = ActiveMetadata::Attachment.create!(
:model_class => metadata_class,
:model_id => metadata_id,
:label => field,
:attach => file,