From 2d475dc6bad3bd7f9afcbf1e072ad6f95b8ed73e Mon Sep 17 00:00:00 2001 From: John Andrews Date: Thu, 29 Aug 2013 11:05:43 -0400 Subject: [PATCH] Include basic information about Mongoid usage --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 3449891c..a3a53994 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,21 @@ class Job < ActiveRecord::Base end ``` +### Mongoid + +AASM also supports persistence to Mongodb if you're using Mongoid. Make sure +to include Mongoid::Document before you include AASM. + +```ruby +class Job + include Mongoid::Document + include AASM + aasm do + ... + end +end +``` + ### Automatic Scopes AASM will automatically create scope methods for each state in the model. @@ -290,6 +305,7 @@ end Since version *3.0.13* AASM supports ActiveRecord transactions. So whenever a transition callback or the state update fails, all changes to any database record are rolled back. +Mongodb does not support transactions. ### Column name & migration