Add this line to your application's Gemfile:
gem 'documents-store'
And then execute:
$ bundle
Or install it yourself as:
$ gem install documents-store
In your project's Gemfile, add following:
gem "mongoid-versioning", :github => "simi/mongoid-versioning"
gem "documents-store", :github => "mindpin/documents-store"
While creating new record, pass creator_id:
attrs = {..., :creator_id => "some_id",...}
DocumentsStore::Document.create(attrs)
While updating existing record, pass last_editor_id:
attrs = {..., :last_editor_id => "some_id",...}
document = DocumentsStore::Document.find("doc_id")
document.update_attributes(attrs)
document.save
Getting participant ids:
document = DocumentsStore::Document.find("doc_id")
document.editor_ids
Getting existing versions:
document = DocumentsStore::Document.find("doc_id")
document.versions
- Fork it ( https://github.com/[my-github-username]/documents-store/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request