app/models/ckeditor/asset.rb in georgia-0.7.7 vs app/models/ckeditor/asset.rb in georgia-0.7.8

- old
+ new

@@ -8,11 +8,11 @@ include Ckeditor::Orm::ActiveRecord::AssetBase include Georgia::Concerns::Taggable delegate :url, :current_path, :content_type, to: :data - mount_uploader :data, CkeditorAttachmentFileUploader, mount_on: :data_file_name + mount_uploader :data, Ckeditor::AttachmentFileUploader, mount_on: :data_file_name validates :data, presence: true attr_accessible :data paginates_per 15 @@ -27,10 +27,15 @@ "delete_url" => media_path(id: id), "delete_type" => "DELETE" } end + def short_name + @short_name ||= self.data.file.filename.dup.gsub(/(.*)\.#{extension}/, '\1') if data.file and data.file.filename + end + def extension + self.data_content_type ||= self.data.file.content_type @extension ||= data_content_type.gsub(/.*\/(.*)/, '\1') end SIZE_RANGE = { '< 25 KB' => 0..25, \ No newline at end of file