1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models
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
..
mongoid Added autocreation of state scopes for Mongoid, including RSpec tests. The interface mirrors the ActiveRecord support for the same. 2013-01-07 07:29:35 +09:00
not_auto_loaded cleaned up the specs 2011-10-15 17:45:24 +02:00
argument.rb started to clean up the specs 2012-11-28 22:42:41 +13:00
auth_machine.rb refactored test for complex example 2012-10-26 22:27:17 +13:00
callback_new_dsl.rb improving tests 2012-12-02 20:51:48 +13:00
callback_old_dsl.rb improving tests 2012-12-02 20:51:48 +13:00
conversation.rb version bump to 3.0.0 (new DSL) 2011-11-26 21:11:57 +01:00
invalid_persistor.rb ActiveRecord persistence can ignore validation when trying to save invalid models 2012-01-16 17:27:15 +01:00
parametrised_event.rb better naming (test classes) 2012-12-02 20:54:58 +13:00
persistence.rb removed test classes from spec itself 2012-10-26 21:52:39 +13:00
process_with_new_dsl.rb made sure, old state callbacks are still working with the new dsl 2011-11-25 23:55:56 +01:00
silencer.rb Add ability to set up transitions without specifying from - these will allow transitioning from ANY state 2012-10-18 23:18:03 -07:00
sub_classing.rb fix initializer to keep existing options (originating from superclass) 2012-04-02 11:44:53 +02:00
transactor.rb supporting ActiveRecord transactions when firing an event 2012-10-24 21:03:09 +13:00
validator.rb ActiveRecord persistence can ignore validation when trying to save invalid models 2012-01-16 17:27:15 +01:00
worker.rb supporting ActiveRecord transactions when firing an event 2012-10-24 21:03:09 +13:00