Skip to content

Commit

Permalink
Fixed mongoid persistence to be compatible with rails 3 and rails 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Oberholzer committed Aug 31, 2010
1 parent b4f02c9 commit 5dc75ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
= Version 0.1.2
* Fixed Mongoid support - Thanks bmartin for pointing that out
2 changes: 2 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* More Persistence layers
* More Tests
* More features
* Speeed!

This is the basics of the gem. Please check out the examples directory or tests for usage until this README gets fleshed out. Feel free to fork and modify as you please.

Expand Down
2 changes: 1 addition & 1 deletion lib/stateflow/persistence/mongoid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Stateflow
module Persistence
module Mongoid
def self.install(base)
base.respond_to?(:before_validation) ? base.before_validation(:ensure_initial_state) : base.before_validation(:ensure_initial_state, :on => :create)
base.respond_to?(:before_validation_on_create) ? base.before_validation_on_create(:ensure_initial_state) : base.before_validation(:ensure_initial_state, :on => :create)
base.send :include, InstanceMethods
end

Expand Down

0 comments on commit 5dc75ac

Please sign in to comment.