lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb in glebtv-ckeditor-4.4.7.4 vs lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb in glebtv-ckeditor-4.5.7
- old
+ new
@@ -1,15 +1,12 @@
class Ckeditor::AttachmentFile < Ckeditor::Asset
has_mongoid_attached_file :data,
:url => "/ckeditor_assets/attachments/:id/:filename",
:path => ":rails_root/public/ckeditor_assets/attachments/:id/:filename"
-
- if respond_to?(:do_not_validate_attachment_file_type)
- do_not_validate_attachment_file_type :data, if: :data?
- end
-
+
+ validates_attachment_presence :data
validates_attachment_size :data, :less_than => 100.megabytes
- validates_attachment_presence :data
+ do_not_validate_attachment_file_type :data
def url_thumb
@url_thumb ||= Ckeditor::Utils.filethumb(filename)
end
end