1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
Commit graph

7 commits

Author SHA1 Message Date
Johnny Shields
13e7090d40 Added autocreation of state scopes for Mongoid, including RSpec tests. The interface mirrors the ActiveRecord support for the same.
Summary of changes
- Added the following methods to persistence/mongoid_persistence.rb
  - find_in_state
  - count_in_state
  - with_state_scope (protected in AR, would argue it should be made public there.
  - I did not port calculate_in_state, due to AR vs. Mongoid API differences; I made with_state_scope public instead. (I think it should be public for AR as well.)
- Moved AASM::Base patch which aliases scopes in persistence/active_record_persistence.rb to persistence/base.rb, and added a Mongoid detection clause to the if statement (in addition to AR). Also deleted commented code from the original method.
- Added 'mongoid' as dev dependency to gemspec
- Created two test files (mongoid_persistance_spec.rb and mongoid_models.rb) covering all my changes.
2013-01-07 07:29:35 +09:00
Thorsten Böttger
2ed43c3d3d a little bit of cleanup for the specs 2012-12-13 22:46:34 +13:00
Thorsten Böttger
f2eeb2e4dc dry up read state (for persistence) 2012-11-05 21:48:44 +13:00
Thorsten Böttger
547b9c30c4 refactored ActiveRecord specs 2012-10-26 22:18:44 +13:00
Thorsten Böttger
7564f87e17 refactored ActiveRecord specs 2012-10-26 22:09:54 +13:00
Thorsten Böttger
f4ccee8272 removed test classes from spec itself 2012-10-26 21:52:39 +13:00
Thorsten Böttger
5954101708 moved persistence spec into its own folder 2012-10-26 21:50:43 +13:00