app/models/ckeditor/picture.rb in georgia-0.7.7 vs app/models/ckeditor/picture.rb in georgia-0.7.8
- old
+ new
@@ -1,15 +1,24 @@
class Ckeditor::Picture < Ckeditor::Asset
- mount_uploader :data, CkeditorPictureUploader, mount_on: :data_file_name
+ mount_uploader :data, Ckeditor::PictureUploader, mount_on: :data_file_name
has_many :contents, foreign_key: :image_id, class_name: Georgia::Content
def featured?
@featured ||= !contents_count.zero?
end
def pages
@pages ||= contents.map(&:contentable).map(&:page).compact.uniq
+ end
+
+ def filename
+ @filename ||=
+ if defined?(Cloudinary)
+ data_file_name.dup.gsub(/v\d{10}\/(.*)/, '\1') || data_file_name
+ else
+ data_file_name
+ end
end
end
\ No newline at end of file