Commit Graph

27 Commits

Author SHA1 Message Date
Thorsten Böttger bbafd22c67 no need for WriteStateWithoutPersistence mixin anymore (to keep adding persistence simple) 2013-04-24 14:19:02 +02:00
Thorsten Böttger 95ef7fc834 no need for WriteState mixin anymore (to keep adding persistence simple) 2013-04-24 13:51:21 +02:00
Thorsten Böttger 52181d8017 keep it simple 2013-04-24 13:05:49 +02:00
Thorsten Böttger 044e84b181 no need for ReadState anymore 2013-04-24 13:03:24 +02:00
Thorsten Böttger 3a331e89ca using Ruby method resolution to read the current state 2013-04-24 12:57:06 +02:00
Thorsten Böttger ede514b115 removed unneeded method (reading the current state for persisted states is already handled) 2013-04-21 18:28:17 +02:00
Thorsten Böttger 233d99b906 continued to refactor instance methods for AASM objects 2013-02-22 19:15:03 +13:00
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 c466d798ae keep it dry 2012-11-05 21:56:42 +13:00
Thorsten Böttger f2eeb2e4dc dry up read state (for persistence) 2012-11-05 21:48:44 +13:00
Thorsten Böttger 05d64cdf37 supporting ActiveRecord transactions when firing an event 2012-10-24 21:03:09 +13:00
Thorsten Böttger 4002c8198c removed trailing whitespace 2012-10-24 18:01:31 +13:00
Thorsten Böttger 54b44c93e4 new version 3.0.6: bugfix: if configured to skip validation the code does not validate anymore 2012-05-17 22:05:43 +12:00
Thorsten Böttger 3860e57c72 bugfix: make sure that scopes are still generated, even with the new DSL 2012-02-23 00:06:08 +13:00
Thorsten Böttger 89622a2413 fixing tests (providing default column in test tables) 2012-02-22 15:25:43 +13:00
Thorsten Böttger 921cfdad5c ActiveRecord persistence can ignore validation when trying to save invalid models 2012-01-16 17:27:15 +01:00
Travis Tilley eced341dfa fix deprecation warnings in rails3 (_without_ breaking rails2) 2010-09-13 04:16:54 -04:00
Travis Tilley ff1f9fbd5e make the NamedScopeMethods test -actually- test that the scope was defined, and fix the silently broken logic for defining scopes in rails 2.x 2010-09-13 00:02:47 -04:00
Travis Tilley d853e9cb26 fix various tests 2010-08-27 16:35:26 -04:00
Richie Vos 84f62932b9 Fix comment typo on aasm_column 2010-08-28 03:18:18 +08:00
David Genord II 2cc59da066 Use scope instead of named_scope 2010-08-28 03:12:21 +08:00
Matt Allen 690137c5e5 Include brackets 2010-02-10 23:26:58 +08:00
Matt Allen fb51ab4d58 Uses Rails 3 "base.before_validation :aasm_ensure_initial_state, :on => :create" method 2010-02-10 13:36:16 +08:00
Adam McCrea 2d8887fdcf Don't persist invalid models 2010-01-29 15:15:34 -05:00
Travis Tilley e97a930897 check to see if the aasm_column is blank 2009-10-20 14:39:29 -04:00
Travis Tilley dc002d4684 cleanup, some refactoring, additional tests (one modeled after a common use of AASM, from restful authentication), fire callbacks on entering initial state, whitespace 2009-10-19 14:38:59 -04:00
Travis Tilley 1e4c038eee reorganize to match rubyist/aasm 2009-08-08 16:53:47 -04:00