Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
reidmorrison committed Feb 14, 2015
1 parent 7134072 commit 436e16d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -17,4 +17,3 @@ alto
.rspec
.bundle
tags
/nbproject/
23 changes: 20 additions & 3 deletions README.md
Expand Up @@ -9,8 +9,8 @@ This package contains AASM, a library for adding finite state machines to Ruby c

AASM started as the *acts_as_state_machine* plugin but has evolved into a more generic library
that no longer targets only ActiveRecord models. It currently provides adapters for
[ActiveRecord](http://api.rubyonrails.org/classes/ActiveRecord/Base.html) and
[Mongoid](http://mongoid.org/), but it can be used for any Ruby class, no matter what
[ActiveRecord](http://api.rubyonrails.org/classes/ActiveRecord/Base.html),
[Mongoid](http://mongoid.org/), and [Mongomapper](http://mongomapper.com/) but it can be used for any Ruby class, no matter what
parent class it has (if any).

## Upgrade from version 3 to 4
Expand Down Expand Up @@ -435,7 +435,7 @@ to ```false```.

### Sequel

AASM also supports [Sequel](http://sequel.jeremyevans.net/) besides _ActiveRecord_ and _Mongoid_.
AASM also supports [Sequel](http://sequel.jeremyevans.net/) besides _ActiveRecord_, _Mongoid_, and _MongoMapper_.

```ruby
class Job < Sequel::Model
Expand Down Expand Up @@ -466,6 +466,23 @@ class Job
end
```

### MongoMapper

AASM also supports persistence to Mongodb if you're using MongoMapper. Make sure
to include MongoMapper::Document before you include AASM.

```ruby
class Job
include MongoMapper::Document
include AASM

key :aasm_state, Symbol
aasm do
...
end
end
```

### Automatic Scopes

AASM will automatically create scope methods for each state in the model.
Expand Down

0 comments on commit 436e16d

Please sign in to comment.