/fog-gridfs_mongoid

Module for the 'fog' gem to support gridfs storage with using mongoid.

Primary LanguageRubyMIT LicenseMIT

Fog::Gridfs (Mongoid)

Installation

Add this line to your application's Gemfile:

gem 'fog-gridfs_mongoid', github: 'dimianstudio/fog-gridfs_mongoid', require: 'fog/gridfs'

And then execute:

$ bundle

Usage

Initialise a Fog::Storage object using local provider

storage = Fog::Storage.new(provider: 'Gridfs')

This can then be used like any other Fog storage.

directory = storage.directories.create(key: '/')
directory.files.create(body: File.open('~/image.png'), key: 'image.png')

Contributing

  1. Fork it ( https://github.com/dimianstudio/fog-gridfs_mongoid/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request