mryurii / shrine-mongoid

Mongoid integration for Shrine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shrine::Plugins::Mongoid

Provides Mongoid integration for Shrine.

Installation

gem "shrine-mongoid"

Usage

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

Contributing

You can run the tests with the Rake task:

$ bundle exec rake test

License

MIT

About

Mongoid integration for Shrine

License:MIT License


Languages

Language:Ruby 100.0%