class Ckeditor::Picture

Public Instance Methods

datasource() click to toggle source
# File lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/picture.rb, line 44
def datasource
  @datasource ||= HashWithIndifferentAccess
                  .new(data)
                  .fetch(:thumb, OpenStruct.new(metadata: {}))
                  .metadata
end
path() click to toggle source
# File lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/picture.rb, line 40
def path
  data[:thumb].storage.path(data[:thumb].id)
end
url_content() click to toggle source

for validation, see github.com/igorkasyanchuk/active_storage_validations

# File lib/generators/ckeditor/templates/active_record/active_storage/ckeditor/picture.rb, line 6
def url_content
  rails_representation_url(storage_data.variant(resize: '800>').processed, only_path: true)
end
url_thumb() click to toggle source
# File lib/generators/ckeditor/templates/active_record/active_storage/ckeditor/picture.rb, line 10
def url_thumb
  rails_representation_url(storage_data.variant(resize: '118x100').processed, only_path: true)
end