app/models/caboose/media.rb in caboose-cms-0.7.41 vs app/models/caboose/media.rb in caboose-cms-0.7.42

- old
+ new

@@ -1,7 +1,8 @@ require 'uri' require 'httparty' +require 'aws-sdk' class Caboose::Media < ActiveRecord::Base self.table_name = "media" belongs_to :media_category @@ -47,10 +48,10 @@ key = URI.encode(key.gsub(' ', '+')) uri = "http://#{bucket}.s3.amazonaws.com/#{key}" image_extensions = ['.jpg', '.jpeg', '.gif', '.png', '.tif'] ext = File.extname(key).downcase - mimetype = Caboose::Mimetype.mimetype_for_extension(ext) + mimetype = Caboose::Mimetype.mimetype_for_extension(ext) if image_extensions.include?(ext) self.image = URI.parse(uri) self.image_content_type = mimetype if mimetype else self.file = URI.parse(uri)