about summary refs log tree commit diff stats
path: root/app/models/ckeditor/attachment_file.rb
blob: fe0913221283bea742720955403b13249cdf24c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
class Ckeditor::AttachmentFile < Ckeditor::Asset
  has_attached_file :data,
                    url: '/uploads/attachments/:id/:filename',
                    path: ':rails_root/public/uploads/attachments/:id/:filename'

  validates_attachment_presence :data
  validates_attachment_size :data, less_than: 100.megabytes
  do_not_validate_attachment_file_type :data

  def url_thumb
    @url_thumb ||= Ckeditor::Utils.filethumb(filename)
  end
end