Provides Mongoid integration for Shrine.
gem "shrine-mongoid"
Shrine.plugin :mongoid
class Post
include Mongoid::Document
include ImageUploader[:image]
field :image_data, type: String
end
post = Post.new
post.image = file
post.image.storage_key #=> "cache"
post.save
post.image.storage_key #=> "store"
post.destroy
post.image.exists? #=> false
You can run the tests with the Rake task:
$ bundle exec rake test