- see issues - https://github.com/nudesign/media_magick/issues
- loosen rails version requirement
- define scopes with lambda, adhering to rails 4 requirements
- automatically requires mini_magick
- now supports just rails 4
- bug fix - http verbs for attachment upload
- updates carrierwave - version 0.9.0
-
bug fix: removes image from file system after remove document
-
bug fix: works after ajax load
-
attachment_container
andattachment_container_for_video
are deprecated. please useattachment_uploader
(for upload) andattachment_loader
for rendering resources -
new option for custom partial render after upload
attachment_uploader(model, relation, type, {loader_partial: 'path/to/custom_loader'})
-
carrierwave ~> 0.8
-
mongoid >= 3.0
-
mini_magick ~> 3.5 (now is a gem dependency)
-
updates jquery - 1.9.1
-
attaches_many :videos - 'videos' is a reserved word
-
attachments for models inside a module [fixed]
Helpers:
-
attachment_container_for_video
doesn't render resources (images or videos) -
updates carrierwave (~> 0.7.0)
-
store image dimensions in mongodb to avoid unnecessary file reads (when call method size - lazy behaviour)
- #2 - video upload for attaches one relation
- Update carrierwave to 0.7.0.
- Update carrierwave to 0.7.0.
- Adding support to videos.
Model:
class Album
include Mongoid::Document
include MediaMagick::Model
attaches_many :medias, allow_videos: true
end
album = Album.create
album.medias.create(video: 'youtube.com/watch?v=FfUHkPf9D9k')
album.reload.photos.first.url
album.reload.photos.first.filename
# Specific methods
album.reload.medias.first.type #=> 'video'
album.reload.medias.first.video #=> 'youtube.com/watch?v=FfUHkPf9D9k'
album.reload.medias.first.source #=> <iframe>youtube video</iframe>
View:
attachment_container_for_video @album, :files
- Adding support to Mongoid 3.
-
Media Magick no longer supports Ruby 1.8.7.
-
Adding the
as
option inattachment_container
to define the partial to be rendered
After:
class Album
include Mongoid::Document
include MediaMagick::Model
attaches_many :files, type: 'file'
end
Now:
attachment_container @album, :files, as: 'file'
- Now newAttachments and loadedAttachments are options for
attachment_container
After:
attachment_container @album, :photos, { class: 'thumbnails' }, { class: 'span3' }, partial: 'albums/photo'
# without newAttachments and loadedAttachments
attachment_container @album, :photos, {}, {}, partial: 'albums/photo'
Now:
attachment_container @album, :photos, newAttachments: { class: 'thumbnails' }, loadedAttachments: { class: 'span3' }, partial: 'albums/photo'
# without newAttachments and loadedAttachments
attachment_container @album, :photos, partial: 'albums/photo'
-
MediaMagick::Model#attachs_many
has been removed in favor ofattaches_many
. -
Removing related relations and the ability to create an image without a father.
- Javascript returning undefined instead of "" prevents attachments from working at embedded documents
- Implementation of
attaches_one
class Album
include Mongoid::Document
include MediaMagick::Model
attaches_one :photo
end
album = Album.create
album.photo.create(photo: params[:file])
album.reload.photo.url
album.reload.photo.filename
attachment_container
can personalize the partial
<%= attachment_container @album, :photos, {}, {}, partial: 'albums/photo' %>
- Allows to create an image without a father in related relations
class Album
include Mongoid::Document
include MediaMagick::Model
attaches_many :photos, :relation => :referenced
end
album = Album.new
photo = album.photos.create(photo: params[:file])
- Allow the
attaches_many
to be used in embedded documents
<%= attachment_container @album, :photos, {}, {}, embedded_in: @album.artist %>
MediaMagick::Model#attachs_many
is deprecated in favor ofattaches_many
.
Initial release.