Module: Ckeditor::Backend::Refile

Extended by:
ActiveSupport::Concern
Included in:
Asset
Defined in:
lib/ckeditor/backend/refile.rb

Instance Method Summary collapse

Instance Method Details

#read_dimensionsObject



27
28
29
30
31
32
33
# File 'lib/ckeditor/backend/refile.rb', line 27

def read_dimensions
  if model.image? && model.has_dimensions?
    magick = MiniMagick::Image.open(model.to_io)
    model.width = magick.width
    model.height = magick.height
  end
end

#url(*attrs) ⇒ Object



23
24
25
# File 'lib/ckeditor/backend/refile.rb', line 23

def url(*attrs)
  ::Refile.attachment_url(self, :data, *attrs)
end