aasm 5.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. checksums.yaml +7 -0
  2. data/.document +6 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. data/.gitignore +20 -0
  6. data/.travis.yml +100 -0
  7. data/API +34 -0
  8. data/Appraisals +71 -0
  9. data/CHANGELOG.md +431 -0
  10. data/CODE_OF_CONDUCT.md +13 -0
  11. data/CONTRIBUTING.md +24 -0
  12. data/Dockerfile +44 -0
  13. data/Gemfile +6 -0
  14. data/Gemfile.lock_old +151 -0
  15. data/HOWTO +12 -0
  16. data/LICENSE +20 -0
  17. data/PLANNED_CHANGES.md +11 -0
  18. data/README.md +1439 -0
  19. data/README_FROM_VERSION_3_TO_4.md +240 -0
  20. data/Rakefile +31 -0
  21. data/TESTING.md +25 -0
  22. data/aasm.gemspec +37 -0
  23. data/callbacks.txt +51 -0
  24. data/docker-compose.yml +40 -0
  25. data/gemfiles/norails.gemfile +10 -0
  26. data/gemfiles/rails_3.2.gemfile +14 -0
  27. data/gemfiles/rails_4.2.gemfile +16 -0
  28. data/gemfiles/rails_4.2_mongoid_5.gemfile +11 -0
  29. data/gemfiles/rails_4.2_nobrainer.gemfile +9 -0
  30. data/gemfiles/rails_5.0.gemfile +13 -0
  31. data/gemfiles/rails_5.0_nobrainer.gemfile +9 -0
  32. data/gemfiles/rails_5.1.gemfile +13 -0
  33. data/gemfiles/rails_5.2.gemfile +13 -0
  34. data/lib/aasm.rb +23 -0
  35. data/lib/aasm/aasm.rb +208 -0
  36. data/lib/aasm/base.rb +271 -0
  37. data/lib/aasm/configuration.rb +45 -0
  38. data/lib/aasm/core/event.rb +172 -0
  39. data/lib/aasm/core/invoker.rb +129 -0
  40. data/lib/aasm/core/invokers/base_invoker.rb +75 -0
  41. data/lib/aasm/core/invokers/class_invoker.rb +52 -0
  42. data/lib/aasm/core/invokers/literal_invoker.rb +47 -0
  43. data/lib/aasm/core/invokers/proc_invoker.rb +59 -0
  44. data/lib/aasm/core/state.rb +90 -0
  45. data/lib/aasm/core/transition.rb +83 -0
  46. data/lib/aasm/dsl_helper.rb +30 -0
  47. data/lib/aasm/errors.rb +21 -0
  48. data/lib/aasm/instance_base.rb +133 -0
  49. data/lib/aasm/localizer.rb +54 -0
  50. data/lib/aasm/minitest.rb +5 -0
  51. data/lib/aasm/minitest/allow_event.rb +13 -0
  52. data/lib/aasm/minitest/allow_transition_to.rb +13 -0
  53. data/lib/aasm/minitest/have_state.rb +13 -0
  54. data/lib/aasm/minitest/transition_from.rb +21 -0
  55. data/lib/aasm/minitest_spec.rb +15 -0
  56. data/lib/aasm/persistence.rb +54 -0
  57. data/lib/aasm/persistence/active_record_persistence.rb +165 -0
  58. data/lib/aasm/persistence/base.rb +78 -0
  59. data/lib/aasm/persistence/core_data_query_persistence.rb +94 -0
  60. data/lib/aasm/persistence/dynamoid_persistence.rb +92 -0
  61. data/lib/aasm/persistence/mongoid_persistence.rb +126 -0
  62. data/lib/aasm/persistence/no_brainer_persistence.rb +105 -0
  63. data/lib/aasm/persistence/orm.rb +150 -0
  64. data/lib/aasm/persistence/plain_persistence.rb +26 -0
  65. data/lib/aasm/persistence/redis_persistence.rb +112 -0
  66. data/lib/aasm/persistence/sequel_persistence.rb +83 -0
  67. data/lib/aasm/rspec.rb +5 -0
  68. data/lib/aasm/rspec/allow_event.rb +26 -0
  69. data/lib/aasm/rspec/allow_transition_to.rb +26 -0
  70. data/lib/aasm/rspec/have_state.rb +22 -0
  71. data/lib/aasm/rspec/transition_from.rb +36 -0
  72. data/lib/aasm/state_machine.rb +53 -0
  73. data/lib/aasm/state_machine_store.rb +76 -0
  74. data/lib/aasm/version.rb +3 -0
  75. data/lib/generators/aasm/aasm_generator.rb +16 -0
  76. data/lib/generators/aasm/orm_helpers.rb +41 -0
  77. data/lib/generators/active_record/aasm_generator.rb +40 -0
  78. data/lib/generators/active_record/templates/migration.rb +8 -0
  79. data/lib/generators/active_record/templates/migration_existing.rb +5 -0
  80. data/lib/generators/mongoid/aasm_generator.rb +28 -0
  81. data/lib/generators/nobrainer/aasm_generator.rb +28 -0
  82. data/lib/motion-aasm.rb +37 -0
  83. data/spec/database.rb +59 -0
  84. data/spec/database.yml +3 -0
  85. data/spec/en.yml +12 -0
  86. data/spec/en_deprecated_style.yml +10 -0
  87. data/spec/generators/active_record_generator_spec.rb +53 -0
  88. data/spec/generators/mongoid_generator_spec.rb +31 -0
  89. data/spec/generators/no_brainer_generator_spec.rb +29 -0
  90. data/spec/models/active_record/basic_active_record_two_state_machines_example.rb +25 -0
  91. data/spec/models/active_record/complex_active_record_example.rb +37 -0
  92. data/spec/models/active_record/derivate_new_dsl.rb +7 -0
  93. data/spec/models/active_record/false_state.rb +35 -0
  94. data/spec/models/active_record/gate.rb +39 -0
  95. data/spec/models/active_record/instance_level_skip_validation_example.rb +19 -0
  96. data/spec/models/active_record/invalid_persistor.rb +29 -0
  97. data/spec/models/active_record/localizer_test_model.rb +34 -0
  98. data/spec/models/active_record/no_direct_assignment.rb +21 -0
  99. data/spec/models/active_record/no_scope.rb +21 -0
  100. data/spec/models/active_record/persisted_state.rb +12 -0
  101. data/spec/models/active_record/person.rb +23 -0
  102. data/spec/models/active_record/provided_and_persisted_state.rb +24 -0
  103. data/spec/models/active_record/reader.rb +7 -0
  104. data/spec/models/active_record/readme_job.rb +21 -0
  105. data/spec/models/active_record/silent_persistor.rb +29 -0
  106. data/spec/models/active_record/simple_new_dsl.rb +32 -0
  107. data/spec/models/active_record/thief.rb +29 -0
  108. data/spec/models/active_record/transactor.rb +124 -0
  109. data/spec/models/active_record/transient.rb +6 -0
  110. data/spec/models/active_record/validator.rb +118 -0
  111. data/spec/models/active_record/with_enum.rb +39 -0
  112. data/spec/models/active_record/with_enum_without_column.rb +38 -0
  113. data/spec/models/active_record/with_false_enum.rb +31 -0
  114. data/spec/models/active_record/with_true_enum.rb +39 -0
  115. data/spec/models/active_record/work.rb +3 -0
  116. data/spec/models/active_record/worker.rb +2 -0
  117. data/spec/models/active_record/writer.rb +6 -0
  118. data/spec/models/basic_two_state_machines_example.rb +25 -0
  119. data/spec/models/callbacks/basic.rb +98 -0
  120. data/spec/models/callbacks/basic_multiple.rb +75 -0
  121. data/spec/models/callbacks/guard_within_block.rb +67 -0
  122. data/spec/models/callbacks/guard_within_block_multiple.rb +66 -0
  123. data/spec/models/callbacks/multiple_transitions_transition_guard.rb +66 -0
  124. data/spec/models/callbacks/multiple_transitions_transition_guard_multiple.rb +65 -0
  125. data/spec/models/callbacks/private_method.rb +44 -0
  126. data/spec/models/callbacks/private_method_multiple.rb +44 -0
  127. data/spec/models/callbacks/with_args.rb +62 -0
  128. data/spec/models/callbacks/with_args_multiple.rb +61 -0
  129. data/spec/models/callbacks/with_state_arg.rb +34 -0
  130. data/spec/models/callbacks/with_state_arg_multiple.rb +29 -0
  131. data/spec/models/complex_example.rb +222 -0
  132. data/spec/models/conversation.rb +93 -0
  133. data/spec/models/default_state.rb +12 -0
  134. data/spec/models/double_definer.rb +21 -0
  135. data/spec/models/dynamoid/complex_dynamoid_example.rb +37 -0
  136. data/spec/models/dynamoid/dynamoid_multiple.rb +18 -0
  137. data/spec/models/dynamoid/dynamoid_simple.rb +18 -0
  138. data/spec/models/foo.rb +106 -0
  139. data/spec/models/foo_callback_multiple.rb +45 -0
  140. data/spec/models/guard_arguments_check.rb +17 -0
  141. data/spec/models/guard_with_params.rb +24 -0
  142. data/spec/models/guard_with_params_multiple.rb +18 -0
  143. data/spec/models/guardian.rb +58 -0
  144. data/spec/models/guardian_multiple.rb +48 -0
  145. data/spec/models/guardian_without_from_specified.rb +18 -0
  146. data/spec/models/initial_state_proc.rb +31 -0
  147. data/spec/models/mongoid/complex_mongoid_example.rb +37 -0
  148. data/spec/models/mongoid/invalid_persistor_mongoid.rb +39 -0
  149. data/spec/models/mongoid/mongoid_relationships.rb +26 -0
  150. data/spec/models/mongoid/no_scope_mongoid.rb +21 -0
  151. data/spec/models/mongoid/silent_persistor_mongoid.rb +39 -0
  152. data/spec/models/mongoid/simple_mongoid.rb +23 -0
  153. data/spec/models/mongoid/simple_new_dsl_mongoid.rb +25 -0
  154. data/spec/models/mongoid/validator_mongoid.rb +100 -0
  155. data/spec/models/multi_transitioner.rb +34 -0
  156. data/spec/models/multiple_transitions_that_differ_only_by_guard.rb +31 -0
  157. data/spec/models/namespaced_multiple_example.rb +42 -0
  158. data/spec/models/no_initial_state.rb +25 -0
  159. data/spec/models/nobrainer/complex_no_brainer_example.rb +36 -0
  160. data/spec/models/nobrainer/invalid_persistor_no_brainer.rb +39 -0
  161. data/spec/models/nobrainer/no_scope_no_brainer.rb +21 -0
  162. data/spec/models/nobrainer/nobrainer_relationships.rb +25 -0
  163. data/spec/models/nobrainer/silent_persistor_no_brainer.rb +39 -0
  164. data/spec/models/nobrainer/simple_new_dsl_nobrainer.rb +25 -0
  165. data/spec/models/nobrainer/simple_no_brainer.rb +23 -0
  166. data/spec/models/nobrainer/validator_no_brainer.rb +98 -0
  167. data/spec/models/not_auto_loaded/process.rb +21 -0
  168. data/spec/models/parametrised_event.rb +42 -0
  169. data/spec/models/parametrised_event_multiple.rb +29 -0
  170. data/spec/models/process_with_new_dsl.rb +31 -0
  171. data/spec/models/provided_state.rb +24 -0
  172. data/spec/models/redis/complex_redis_example.rb +40 -0
  173. data/spec/models/redis/redis_multiple.rb +20 -0
  174. data/spec/models/redis/redis_simple.rb +20 -0
  175. data/spec/models/sequel/complex_sequel_example.rb +46 -0
  176. data/spec/models/sequel/invalid_persistor.rb +52 -0
  177. data/spec/models/sequel/sequel_multiple.rb +25 -0
  178. data/spec/models/sequel/sequel_simple.rb +26 -0
  179. data/spec/models/sequel/silent_persistor.rb +50 -0
  180. data/spec/models/sequel/transactor.rb +112 -0
  181. data/spec/models/sequel/validator.rb +93 -0
  182. data/spec/models/sequel/worker.rb +12 -0
  183. data/spec/models/silencer.rb +27 -0
  184. data/spec/models/simple_custom_example.rb +53 -0
  185. data/spec/models/simple_example.rb +23 -0
  186. data/spec/models/simple_example_with_guard_args.rb +17 -0
  187. data/spec/models/simple_multiple_example.rb +42 -0
  188. data/spec/models/state_machine_with_failed_event.rb +20 -0
  189. data/spec/models/states_on_one_line_example.rb +8 -0
  190. data/spec/models/sub_class.rb +41 -0
  191. data/spec/models/sub_class_with_more_states.rb +18 -0
  192. data/spec/models/sub_classing.rb +3 -0
  193. data/spec/models/super_class.rb +46 -0
  194. data/spec/models/this_name_better_not_be_in_use.rb +11 -0
  195. data/spec/models/valid_state_name.rb +23 -0
  196. data/spec/spec_helper.rb +36 -0
  197. data/spec/spec_helpers/active_record.rb +8 -0
  198. data/spec/spec_helpers/dynamoid.rb +35 -0
  199. data/spec/spec_helpers/mongoid.rb +26 -0
  200. data/spec/spec_helpers/nobrainer.rb +15 -0
  201. data/spec/spec_helpers/redis.rb +18 -0
  202. data/spec/spec_helpers/remove_warnings.rb +1 -0
  203. data/spec/spec_helpers/sequel.rb +7 -0
  204. data/spec/unit/abstract_class_spec.rb +27 -0
  205. data/spec/unit/api_spec.rb +100 -0
  206. data/spec/unit/basic_two_state_machines_example_spec.rb +10 -0
  207. data/spec/unit/callback_multiple_spec.rb +304 -0
  208. data/spec/unit/callbacks_spec.rb +521 -0
  209. data/spec/unit/complex_example_spec.rb +93 -0
  210. data/spec/unit/complex_multiple_example_spec.rb +115 -0
  211. data/spec/unit/edge_cases_spec.rb +16 -0
  212. data/spec/unit/event_multiple_spec.rb +73 -0
  213. data/spec/unit/event_naming_spec.rb +16 -0
  214. data/spec/unit/event_spec.rb +394 -0
  215. data/spec/unit/exception_spec.rb +11 -0
  216. data/spec/unit/guard_arguments_check_spec.rb +9 -0
  217. data/spec/unit/guard_multiple_spec.rb +60 -0
  218. data/spec/unit/guard_spec.rb +89 -0
  219. data/spec/unit/guard_with_params_multiple_spec.rb +10 -0
  220. data/spec/unit/guard_with_params_spec.rb +14 -0
  221. data/spec/unit/guard_without_from_specified_spec.rb +10 -0
  222. data/spec/unit/initial_state_multiple_spec.rb +15 -0
  223. data/spec/unit/initial_state_spec.rb +12 -0
  224. data/spec/unit/inspection_multiple_spec.rb +201 -0
  225. data/spec/unit/inspection_spec.rb +149 -0
  226. data/spec/unit/invoker_spec.rb +189 -0
  227. data/spec/unit/invokers/base_invoker_spec.rb +72 -0
  228. data/spec/unit/invokers/class_invoker_spec.rb +95 -0
  229. data/spec/unit/invokers/literal_invoker_spec.rb +86 -0
  230. data/spec/unit/invokers/proc_invoker_spec.rb +86 -0
  231. data/spec/unit/localizer_spec.rb +78 -0
  232. data/spec/unit/memory_leak_spec.rb +38 -0
  233. data/spec/unit/multiple_transitions_that_differ_only_by_guard_spec.rb +14 -0
  234. data/spec/unit/namespaced_multiple_example_spec.rb +75 -0
  235. data/spec/unit/new_dsl_spec.rb +12 -0
  236. data/spec/unit/override_warning_spec.rb +94 -0
  237. data/spec/unit/persistence/active_record_persistence_multiple_spec.rb +618 -0
  238. data/spec/unit/persistence/active_record_persistence_spec.rb +773 -0
  239. data/spec/unit/persistence/dynamoid_persistence_multiple_spec.rb +135 -0
  240. data/spec/unit/persistence/dynamoid_persistence_spec.rb +84 -0
  241. data/spec/unit/persistence/mongoid_persistence_multiple_spec.rb +200 -0
  242. data/spec/unit/persistence/mongoid_persistence_spec.rb +165 -0
  243. data/spec/unit/persistence/no_brainer_persistence_multiple_spec.rb +198 -0
  244. data/spec/unit/persistence/no_brainer_persistence_spec.rb +158 -0
  245. data/spec/unit/persistence/redis_persistence_multiple_spec.rb +88 -0
  246. data/spec/unit/persistence/redis_persistence_spec.rb +53 -0
  247. data/spec/unit/persistence/sequel_persistence_multiple_spec.rb +148 -0
  248. data/spec/unit/persistence/sequel_persistence_spec.rb +368 -0
  249. data/spec/unit/readme_spec.rb +41 -0
  250. data/spec/unit/reloading_spec.rb +15 -0
  251. data/spec/unit/rspec_matcher_spec.rb +88 -0
  252. data/spec/unit/simple_custom_example_spec.rb +39 -0
  253. data/spec/unit/simple_example_spec.rb +57 -0
  254. data/spec/unit/simple_multiple_example_spec.rb +91 -0
  255. data/spec/unit/state_spec.rb +89 -0
  256. data/spec/unit/states_on_one_line_example_spec.rb +16 -0
  257. data/spec/unit/subclassing_multiple_spec.rb +74 -0
  258. data/spec/unit/subclassing_spec.rb +46 -0
  259. data/spec/unit/transition_spec.rb +436 -0
  260. data/test/minitest_helper.rb +57 -0
  261. data/test/unit/minitest_matcher_test.rb +80 -0
  262. metadata +609 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c02be243049ac08482ee6dd9de9b388d7f965019012f680507b75aee43e1819c
4
+ data.tar.gz: e41809b4fd44cd1d5358e4da499c6b2691caf6a2b6f0b1cf24816458af711522
5
+ SHA512:
6
+ metadata.gz: c5e49eeff60a68201dccfd988525030946a5f4e2ff080a8818ec729f7bb88291b6f333ccf8666a241dfb72b38a2f30333afbc4d284c3c6103eaab49446630b8e
7
+ data.tar.gz: d2d16d9368d1c8dfd8f50baaea1f07b525798a017fc612c27705161606ae27e1cdd1ea15b979d6d916cfd8abaa81479ff20c72577f8dbbd140dcb78572683845
@@ -0,0 +1,6 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ -
6
+ LICENSE
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Additional context**
27
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,20 @@
1
+ *.sw?
2
+ *~
3
+ .DS_Store
4
+ .idea
5
+ coverage
6
+ pkg
7
+ rdoc
8
+ Gemfile.lock
9
+ gemfiles/*.lock
10
+ spec/debug.log
11
+ spec/*.db
12
+ TODO
13
+ .rvmrc
14
+ .ruby-version
15
+ .ruby-gemset
16
+ alto
17
+ .rspec
18
+ .bundle
19
+ tags
20
+ tmp
@@ -0,0 +1,100 @@
1
+ sudo: false
2
+ language: ruby
3
+ cache: bundler
4
+
5
+ jdk:
6
+ - openjdk8
7
+
8
+ before_install:
9
+ - rvm list
10
+ - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
11
+ - gem install bundler -v '1.16.1'
12
+ - bundle _1.16.1_ install
13
+
14
+ rvm:
15
+ - 2.3.0
16
+ - 2.5.0
17
+ - 2.6.5
18
+ - 2.7.0
19
+ - jruby-9.1.12.0
20
+
21
+ services:
22
+ - mongodb
23
+ - redis-server
24
+
25
+ #addons:
26
+ # rethinkdb: '2.3.4'
27
+
28
+ gemfile:
29
+ - gemfiles/norails.gemfile
30
+ - gemfiles/rails_3.2.gemfile
31
+ - gemfiles/rails_4.2.gemfile
32
+ - gemfiles/rails_4.2_mongoid_5.gemfile
33
+ # - gemfiles/rails_4.2_nobrainer.gemfile
34
+ - gemfiles/rails_5.0.gemfile
35
+ # - gemfiles/rails_5.0_nobrainer.gemfile
36
+ - gemfiles/rails_5.1.gemfile
37
+ - gemfiles/rails_5.2.gemfile
38
+
39
+ before_script:
40
+ - mkdir /tmp/dynamodb
41
+ - wget -O - https://s3-ap-southeast-1.amazonaws.com/dynamodb-local-singapore/dynamodb_local_latest.tar.gz | tar xz --directory /tmp/dynamodb
42
+ - java -Djava.library.path=/tmp/dynamodb/DynamoDBLocal_lib -jar /tmp/dynamodb/DynamoDBLocal.jar -inMemory -delayTransientStatuses -port 30180 &
43
+ - mongod --version
44
+
45
+ script:
46
+ - bundle exec rspec spec
47
+ - bundle exec rake test
48
+
49
+ matrix:
50
+ exclude:
51
+ - rvm: 2.3.0
52
+ gemfile: gemfiles/norails.gemfile
53
+ - rvm: 2.3.0
54
+ gemfile: gemfiles/rails_5.0.gemfile
55
+ # - rvm: 2.3.0
56
+ # gemfile: gemfiles/rails_5.0_nobrainer.gemfile
57
+ - rvm: 2.3.0
58
+ gemfile: gemfiles/rails_5.1.gemfile
59
+ - rvm: 2.3.0
60
+ gemfile: gemfiles/rails_5.2.gemfile
61
+ - rvm: 2.7.0
62
+ gemfile: gemfiles/rails_5.2.gemfile
63
+ - rvm: 2.6.5
64
+ gemfile: gemfiles/rails_5.2.gemfile
65
+ - rvm: 2.5.0
66
+ gemfile: gemfiles/rails_3.2.gemfile
67
+ - rvm: 2.6.5
68
+ gemfile: gemfiles/rails_3.2.gemfile
69
+ - rvm: 2.7.0
70
+ gemfile: gemfiles/rails_3.2.gemfile
71
+ - rvm: 2.5.0
72
+ gemfile: gemfiles/rails_4.2.gemfile
73
+ - rvm: 2.6.5
74
+ gemfile: gemfiles/rails_4.2.gemfile
75
+ - rvm: 2.7.0
76
+ gemfile: gemfiles/rails_4.2.gemfile
77
+ - rvm: 2.5.0
78
+ gemfile: gemfiles/rails_4.2_mongoid_5.gemfile
79
+ - rvm: 2.6.5
80
+ gemfile: gemfiles/rails_4.2_mongoid_5.gemfile
81
+ - rvm: 2.7.0
82
+ gemfile: gemfiles/rails_4.2_mongoid_5.gemfile
83
+ # - rvm: 2.5.0
84
+ # gemfile: gemfiles/rails_4.2_nobrainer.gemfile
85
+ - rvm: jruby-9.1.12.0
86
+ gemfile: gemfiles/norails.gemfile
87
+ - rvm: jruby-9.1.12.0
88
+ gemfile: gemfiles/rails_5.0.gemfile
89
+ - rvm: jruby-9.1.12.0
90
+ gemfile: gemfiles/rails_5.1.gemfile
91
+ - rvm: jruby-9.1.12.0
92
+ gemfile: gemfiles/rails_5.2.gemfile
93
+ # - rvm: jruby-9.1.12.0
94
+ # gemfile: gemfiles/rails_4.2_nobrainer.gemfile
95
+ # - rvm: jruby-9.1.12.0
96
+ # gemfile: gemfiles/rails_5.0_nobrainer.gemfile
97
+
98
+ notifications:
99
+ slack:
100
+ secure: gpltVWntdKz0nSE6A5UvuX4qbN35uW51nsW+Ojgqm8Qsv8K240/NlZRYutFHr7GnJTe0rEEP2Oy3ZBnBtZKFn13RlTEAU/FCAxebr4H24rr29Ypwwp5xjiSE4MuoBEnroo4lw6ka3LsJnrY2PKRMiLJGsS0WsEPY4x8NUG/vyY8=
data/API ADDED
@@ -0,0 +1,34 @@
1
+
2
+ Overwrite method to read the current state. Used to provide another storage mechanism,
3
+ different from the standard Rails read_attribute method.
4
+
5
+ class MyClass
6
+ include AASM
7
+
8
+ def aasm_read_state
9
+ # retrieve the current state manually
10
+ end
11
+ end
12
+
13
+
14
+ Overwrite method to write the current state (and actually persist it). Used to provide
15
+ another storage mechanism, different from the standard Rails write_attribute method.
16
+
17
+ class MyClass
18
+ include AASM
19
+
20
+ def aasm_write_state
21
+ # store and persist the current state manually
22
+ end
23
+ end
24
+
25
+
26
+ Overwrite method to write the current state (without persisting it).
27
+
28
+ class MyClass
29
+ include AASM
30
+
31
+ def aasm_write_state_without_persistence
32
+ # store the current state manually
33
+ end
34
+ end
@@ -0,0 +1,71 @@
1
+ appraise 'rails_3.2' do
2
+ gem 'rails', '~> 3.2.22'
3
+ gem 'mongoid', '~> 3.1'
4
+ gem 'sequel'
5
+ gem 'bson_ext', platforms: :ruby
6
+ gem 'test-unit', '~> 3.0'
7
+ gem 'minitest'
8
+ gem 'activerecord-jdbcsqlite3-adapter', '1.3.24', platforms: :jruby
9
+ end
10
+
11
+ appraise 'rails_4.2' do
12
+ gem 'nokogiri', '1.6.8.1', platforms: %i[ruby_19]
13
+ gem 'mime-types', '~> 2', platforms: %i[ruby_19 jruby]
14
+ gem 'rails', '4.2.5'
15
+ gem 'mongoid', '~> 4.0'
16
+ gem 'sequel'
17
+ gem 'dynamoid', '~> 1', platforms: :ruby
18
+ gem 'aws-sdk', '~> 2', platforms: :ruby
19
+ gem 'redis-objects'
20
+ gem 'activerecord-jdbcsqlite3-adapter', '1.3.24', platforms: :jruby
21
+ end
22
+
23
+ appraise 'rails_4.2_nobrainer' do
24
+ gem 'rails', '4.2.5'
25
+ gem 'nobrainer', '~> 0.33.0'
26
+ end
27
+
28
+ appraise 'rails_4.2_mongoid_5' do
29
+ gem 'mime-types', '~> 2', platforms: %i[ruby_19 jruby]
30
+ gem 'rails', '4.2.5'
31
+ gem 'mongoid', '~> 5.0'
32
+ gem 'activerecord-jdbcsqlite3-adapter', '1.3.24', platforms: :jruby
33
+ end
34
+
35
+ appraise 'rails_5.0' do
36
+ gem 'rails', '5.0.0'
37
+ gem 'mongoid', '~> 6.0'
38
+ gem 'sequel'
39
+ gem 'dynamoid', '~> 1.3', platforms: :ruby
40
+ gem 'aws-sdk', '~> 2', platforms: :ruby
41
+ gem 'redis-objects'
42
+ end
43
+
44
+ appraise 'rails_5.0_nobrainer' do
45
+ gem 'rails', '5.0.0'
46
+ gem 'nobrainer', '~> 0.33.0'
47
+ end
48
+
49
+ appraise 'rails_5.1' do
50
+ gem 'rails', '5.1'
51
+ gem 'mongoid', '~>6.0'
52
+ gem 'sequel'
53
+ gem 'dynamoid', '~> 1.3', platforms: :ruby
54
+ gem 'aws-sdk', '~>2', platforms: :ruby
55
+ gem 'redis-objects'
56
+ end
57
+
58
+ appraise 'rails_5.2' do
59
+ gem 'rails', '5.2'
60
+ gem 'mongoid', '~>6.0'
61
+ gem 'sequel'
62
+ gem 'dynamoid', '~>2.2', platforms: :ruby
63
+ gem 'aws-sdk', '~>2', platforms: :ruby
64
+ gem 'redis-objects'
65
+ end
66
+
67
+ appraise 'norails' do
68
+ gem 'rails', install_if: false
69
+ gem 'sequel'
70
+ gem 'redis-objects'
71
+ end
@@ -0,0 +1,431 @@
1
+ # CHANGELOG
2
+
3
+ ## unreleased
4
+
5
+ ## 5.0.8
6
+
7
+ * Revert Fix for :after_commit within nested transaction because it adds after_commit_action dependency which is dependent on many gems.
8
+
9
+ ## 5.0.7
10
+
11
+ * Fix :after_commit within nested transaction [#666](https://github.com/aasm/aasm/pull/666), thanks to [stokarenko](https://github.com/stokarenko)
12
+ * Add permitted_transitions to group permitted event with state [#664](https://github.com/aasm/aasm/pull/664), thanks to [dnamsons](https://github.com/dnamsons)
13
+ * Add Ruby 2.7.0 & 2.6.5 to Travis CI Test Matrix [#661](https://github.com/aasm/aasm/pull/661), thanks to [the-spectator](https://github.com/the-spectator)
14
+ * Handle InvalidTransition in transition_from matcher [#653](https://github.com/aasm/aasm/pull/653), thanks to [ryanwood](https://github.com/ryanwood)
15
+
16
+ ## 5.0.6
17
+
18
+ * Fix no_direct_assignment, couldn't be turned off pragmatically [#636](https://github.com/aasm/aasm/issues/636)
19
+ * Add instance level validation skip option [#644](https://github.com/aasm/aasm/pull/644), thanks to [Nitin-Salunke](https://github.com/Nitin-Salunke)
20
+ * Fixed aasm.current_event incorrectly yields nil when calling aasm.fire!(:event) [#551](https://github.com/aasm/aasm/issues/551) in [#638](https://github.com/aasm/aasm/pull/638), thanks to [DoubleJarvis](https://github.com/DoubleJarvis)
21
+ * Code Refactor [#634](https://github.com/aasm/aasm/pull/634) , thanks to [rahulknojha](https://github.com/rahulknojha)
22
+ * Fixed callback argument for :before_success & :success callback, [#630](https://github.com/aasm/aasm/pull/630)
23
+
24
+ ## 5.0.5
25
+
26
+ * Independent of ActiveSupport methods, [#627](https://github.com/aasm/aasm/pull/627),
27
+ thanks to [tristandruyen](https://github.com/tristandruyen). Fixes [#508](https://github.com/aasm/aasm/issues/508)
28
+
29
+ ## 5.0.4
30
+
31
+ * Specify dynamoid version for Rails > 5, [#625](https://github.com/aasm/aasm/pull/625),
32
+ thanks to [waghanza](https://github.com/waghanza)
33
+ * Add travis runner for Rails 5.2, [#624](https://github.com/aasm/aasm/pull/624), thanks
34
+ to [waghanza](https://github.com/waghanza)
35
+ * Cleanup Abstract class issue, [#620](https://github.com/aasm/aasm/pull/620), thanks to
36
+ [dennym](https://github.com/dennym)
37
+
38
+ ## 5.0.3
39
+
40
+ * Fix Abstract class issue, [#619](https://github.com/aasm/aasm/pull/619)
41
+
42
+ ## 5.0.2
43
+
44
+ * Clear failed callbacks, [#600](https://github.com/aasm/aasm/pull/600), thanks to
45
+ [nedgar](https://github.com/nedgar)
46
+ * README improvements, [#594](https://github.com/aasm/aasm/pull/594),
47
+ [#589](https://github.com/aasm/aasm/pull/589), [#587](https://github.com/aasm/aasm/pull/587),
48
+ [#597](https://github.com/aasm/aasm/pull/597), thanks to [jackscotti](https://github.com/jackscotti), [krmbzds](https://github.com/krmbzds),
49
+ [zegomesjf](https://github.com/zegomesjf), [BKSpurgeon](https://github.com/BKSpurgeon)
50
+ * Update InvalidTransition to include state_machine_name [#592](https://github.com/aasm/aasm/pull/592), thanks to [a14m](https://github.com/a14m)
51
+ * Do not add migration if model and column already exists [#586](https://github.com/aasm/aasm/pull/586), thanks to [KiranJosh](https://github.com/KiranJosh)
52
+
53
+ ## 5.0.1
54
+
55
+ * Fix failures array in transition not being reset [#383](https://github.com/aasm/aasm/issues/383)
56
+ * Enable AASM scopes to be defined on abstract classes.
57
+
58
+ ## 5.0.0
59
+
60
+ * Chore(invokers): Refactor callback invokers, add class-callbacks support [#541](https://github.com/aasm/aasm/pull/541), thanks to [pandomic](https://github.com/pandomic)
61
+ * Add docker setup to readme
62
+ * Add support for Nobrainer (RethinkDB) [#522](https://github.com/aasm/aasm/pull/522), thanks to [zedtux](https://github.com/zedtux)
63
+ * Patch `allow_event` to accept event with custom arguments [#419](https://github.com/aasm/aasm/pull/419), thanks to [czhc](https://github.com/czhc)
64
+
65
+ ## 4.12.3
66
+
67
+ * Add to AASM fire(event) and fire!(event) methods [#494](https://github.com/aasm/aasm/pull/494), thanks to [slayer](https://github.com/slayer)
68
+ * Add `use_transactions` flag to persist changes to the database even when some error occurs. [#493](https://github.com/aasm/aasm/pull/493), thanks to Peter Lampesberger.
69
+
70
+ ## 4.12.2
71
+
72
+ * Fix guards parameter [#484](https://github.com/aasm/aasm/pull/484), thanks to [teohm](https://github.com/teohm)
73
+ * Make errors more inspectable [#452](https://github.com/aasm/aasm/pull/452), thanks to [flexoid](https://github.com/flexoid)
74
+ * Enable Dynamoid for Rails 5 [#483](https://github.com/aasm/aasm/pull/483), thanks to [focusshifter](https://github.com/focusshifter)
75
+
76
+ ## 4.12.1
77
+
78
+ * DRY-up Mongoid and ActiveRecord Persistence, Add Sequel transactions and locking [#475](https://github.com/aasm/aasm/pull/475), thanks to [@Aryk](https://github.com/Aryk)
79
+ * Add aliases for event methods [#476](https://github.com/aasm/aasm/pull/476), thanks to [@Aryk](https://github.com/Aryk)
80
+ * Support Minitest spec expectations [#387](https://github.com/aasm/aasm/pull/387), thanks to [@faragorn](https://github.com/faragorn)
81
+ ## 4.12.0
82
+
83
+ * Fix thread safe issue with concurrent-ruby gem [see [pull-request #422](https://github.com/aasm/aasm/pull/442), thanks to [@reidmorrison](https://github.com/reidmorrison)
84
+ * Drop Support for Mongo Mapper [see [pull-request #439](https://github.com/aasm/aasm/pull/439)], thanks to [@reidmorrison](https://github.com/reidmorrison)
85
+ * add :binding_event option to event [see [pull-request #438](https://github.com/aasm/aasm/pull/438)], thanks to [@leanhdaovn](https://github.com/leanhdaovn)
86
+ * fix: `skip_validation_on_save: true` for default_scope records, [see [pull-request #433](https://github.com/aasm/aasm/pull/433)], thanks to [@larissa](https://github.com/larissa)
87
+ * Deep clone state machine during inheritance so that state machines in child classes can be modified (see [pull-request #429](https://github.com/aasm/aasm/pull/429)), thanks to [@reidmorrison](https://github.com/reidmorrison) and [@Tybot204](https://github.com/Tybot204)
88
+ * add before_success callback for event (see [pull-request #422](https://github.com/aasm/aasm/pull/422)), thanks to [@timsly ](https://github.com/timsly)
89
+ * fix: multiple transitions in a single event with the same to and from states (see [issue #372](https://github.com/aasm/aasm/issues/372) and [issue #362](https://github.com/aasm/aasm/issues/362) for details, fixed with [pull-request #408](https://github.com/aasm/aasm/pull/408), thanks to [@dathanb](https://github.com/dathanb))
90
+ * fix: passing nil as a argument to callbacks (see [issue #404](https://github.com/aasm/aasm/issues/404) for details, fixed with [pull-request #406](https://github.com/aasm/aasm/pull/406), thanks to [@yogeshjain999](https://github.com/yogeshjain999))
91
+
92
+
93
+ ## 4.11.1
94
+
95
+ * fix: generator file name when using custom column name instead of
96
+ aasm_state (see [issue #398](https://github.com/aasm/aasm/pull/398) for details,
97
+ thanks to [@bastianwegge](https://github.com/bastianwegge))
98
+ * fix: Scopes when states are defined as a series of symbols (see [issue #397](https://github.com/aasm/aasm/pull/397) for details, thanks to [@evheny0](https://github.com/evheny0))
99
+ * fix: Multiple transition behavior when one of the transitions does not
100
+ have a "from" parameter (see [issue #392](https://github.com/aasm/aasm/issues/392) for details)
101
+ * fix: permissible states not respecting guard parameters (see [issue #388](https://github.com/aasm/aasm/issues/388)) with [pull-request #389](https://github.com/aasm/aasm/pull/389)
102
+
103
+ ## 4.11.0
104
+
105
+ * support `logger` configuration (see [issue #370](https://github.com/aasm/aasm/pull/370) for details, thanks to [@HoyaBoya](https://github.com/HoyaBoya))
106
+ * support configuration to let bang transitions fail if object is invalid (see [issue #366](https://github.com/aasm/aasm/pull/366) and [issue #262](https://github.com/aasm/aasm/issues/262) for details, thanks to [@Wildebeest](https://github.com/Wildebeest))
107
+
108
+
109
+ ## 4.10.1
110
+
111
+ * fix: suppress warnings when using ActiveRecord enums feature (see [issue #346](https://github.com/aasm/aasm/pull/346) for details, thanks to [@110y](https://github.com/110y), and [issue #353](https://github.com/aasm/aasm/pull/353) for details, thanks to [@nathanstitt](https://github.com/nathanstitt))
112
+ * fix: handle array of success callbacks for transitions properly (see [issue #363](https://github.com/aasm/aasm/pull/363) for details, thanks to [@shunichi](https://github.com/shunichi))
113
+ * support `permitted: false` for states and events query/inspection methods (see [issue #364](https://github.com/aasm/aasm/pull/364) for details, thanks to [@hspazio](https://github.com/hspazio))
114
+
115
+ ## 4.10.0
116
+
117
+ * fix: some issues with RubyMotion (see [issue #320](https://github.com/aasm/aasm/pull/320) and [issue #343](https://github.com/aasm/aasm/pull/343) for details, thanks to [@Infotaku](https://github.com/Infotaku))
118
+ * fix: transitions now work in dup'ed copies (see [issue #325](https://github.com/aasm/aasm/pull/325) which fixes [issue #273](https://github.com/aasm/aasm/pull/273) for details, thanks to [@lingceng](https://github.com/lingceng))
119
+ * fix: allow skipping the `aasm_ensure_initial_state` callback (see [issue #326](https://github.com/aasm/aasm/pull/326) for details, thanks to [@sineed](https://github.com/sineed))
120
+ * fix: has_many association helper works again for Mongoid (see [issue #333](https://github.com/aasm/aasm/pull/333) which fixes [issue #332](https://github.com/aasm/aasm/pull/332) for details, thanks to [@anilmaurya](https://github.com/anilmaurya))
121
+ * improve performance / refactor: load and run only code which is needed (see [issue #336](https://github.com/aasm/aasm/pull/336) for details, thanks to [@csmuc](https://github.com/csmuc))
122
+ * improve: warn when overriding an existing method (see [issue #340](https://github.com/aasm/aasm/pull/340) which fixes [issue #335](https://github.com/aasm/aasm/pull/335) for details, thanks to [@pirj](https://github.com/pirj))
123
+ * fix: correct error message (by not evaluating the current state lazily) (see [issue #341](https://github.com/aasm/aasm/pull/341) which fixes [issue #312](https://github.com/aasm/aasm/pull/312) for details, thanks to [@pirj](https://github.com/pirj))
124
+ * addition: support for Redis as persistence layer (see [issue #190](https://github.com/aasm/aasm/pull/190) for details, thanks to [@javajax](https://github.com/javajax))
125
+ * addition: support transition `:success` callbacks (see [issue #239](https://github.com/aasm/aasm/pull/239) which fixes [issue #236](https://github.com/aasm/aasm/pull/236) for details, thanks to [@brega](https://github.com/brega))
126
+ * addition: support for namespacing methods and state names (see [issue #259](https://github.com/aasm/aasm/pull/259) for details, thanks to [@allspiritseve](https://github.com/allspiritseve))
127
+ * addition: support for defining multiple states in one line (see [issue #288](https://github.com/aasm/aasm/pull/288) which fixes [issue #146](https://github.com/aasm/aasm/pull/146) for details, thanks to [@HParker](https://github.com/HParker))
128
+ * fix: uninitialised constant when running Rails generator (see [issue #339](https://github.com/aasm/aasm/pull/339) for details, thanks to [@long-long-float](https://github.com/long-long-float))
129
+
130
+ ## 4.9.0
131
+
132
+ * add support for callback classes (`after` only) (see [issue #316](https://github.com/aasm/aasm/pull/316) for details, thanks to [@mlr](https://github.com/mlr))
133
+ * allow easier extension of _AASM_ (utilising the idea of _ApplicationRecords_ from _Rails 5_) (see [issue #296](https://github.com/aasm/aasm/pull/296) for details, thanks to [@mlr](https://github.com/mlr))
134
+ * support pessimistic locking for _ActiveRecord_ (see [issue #283](https://github.com/aasm/aasm/pull/283) for details, thanks to [@HoyaBoya](https://github.com/HoyaBoya))
135
+ * fix: support database sharding for _ActiveRecord_ (see [issue #289](https://github.com/aasm/aasm/pull/289) for details, thanks to [@scambra](https://github.com/scambra))
136
+ * fix: some issues with RubyMotion (see [issue #318](https://github.com/aasm/aasm/pull/318) for details, thanks to [@Infotaku](https://github.com/Infotaku))
137
+ * fix: Rails generator now features the correct namespace (see [issue #328](https://github.com/aasm/aasm/pull/328) and [issue #329](https://github.com/aasm/aasm/pull/329) for details, thanks to [@anilmaurya](https://github.com/anilmaurya))
138
+
139
+
140
+ ## 4.8.0
141
+
142
+ * add support for [dynamoid](http://joshsymonds.com/Dynamoid/) (see [issue #300](https://github.com/aasm/aasm/pull/300) for details, thanks to [@LeeChSien](https://github.com/LeeChSien))
143
+ * make compatible with [RubyMotion](http://www.rubymotion.com) (see [issue #315](https://github.com/aasm/aasm/pull/315) for details, thanks to [@Infotaku](https://github.com/Infotaku))
144
+ * improve error handling in case of an exception during transitioning (see [issue #275](https://github.com/aasm/aasm/pull/275) for details, thanks to [@chriswoodrich](https://github.com/chriswoodrich))
145
+ * rspec matcher `on_event` now supports arguments (see [issue #309](https://github.com/aasm/aasm/pull/309) for details, thanks to [@zacviandier](https://github.com/zacviandier))
146
+ * fix: permitted states now respect guards (see [issue #308](https://github.com/aasm/aasm/pull/308) for details, thanks to [@eebs](https://github.com/eebs))
147
+ * fix: reloading the env now doesn't add callbacks twice anymore (see [issue #311](https://github.com/aasm/aasm/pull/311) for details, thanks to [@lingceng](https://github.com/lingceng))
148
+
149
+ ## 4.7.0
150
+
151
+ * fix: allow :send as event name (see [issue #257](https://github.com/aasm/aasm/issues/257) for details)
152
+ * add new callbacks: transactions, all events, ensure (see [issue #282](https://github.com/aasm/aasm/issues/282) for details, thanks to [@HoyaBoya](https://github.com/HoyaBoya))
153
+
154
+ ## 4.6.0
155
+
156
+ * fix: make sure the column is actually present for _ActiveRecord_ enums (see [issue #265](https://github.com/aasm/aasm/issues/265) and [issue #152](https://github.com/aasm/aasm/issues/152) for details, thanks to [@anilmaurya](https://github.com/anilmaurya))
157
+ * add generators to configure active_record and mongoid after install (see [issue #261](https://github.com/aasm/aasm/issues/261) for details, thanks to [@anilmaurya](https://github.com/anilmaurya))
158
+
159
+ ## 4.5.2
160
+
161
+ * fix arity difference between Procs and lambdas (see [issue #293](https://github.com/aasm/aasm/issues/293) for details)
162
+
163
+ ## 4.5.1
164
+
165
+ * make sure to use override configuration options if state machine is defined more than once (see [issue #287](https://github.com/aasm/aasm/issues/287) for details)
166
+
167
+ ## 4.5.0
168
+
169
+ * add RSpec matchers `have_state`, `allow_event` and `allow_transition_to` (see [issue #147](https://github.com/aasm/aasm/issues/147) for details)
170
+ * add RSpec matcher `transition_from` (see [issue #178](https://github.com/aasm/aasm/issues/178) for details, thanks to [@thomasstephane](https://github.com/thomasstephane))
171
+
172
+ ## 4.4.1
173
+
174
+ * add support for rejecting certain events on inspection (see [issue #272](https://github.com/aasm/aasm/issues/272) for details, thanks to [@dubroe](https://github.com/dubroe))
175
+
176
+ ## 4.4.0
177
+
178
+ * add support global transation callbacks (see [issue #221](https://github.com/aasm/aasm/issues/221) and [issue #253](https://github.com/aasm/aasm/issues/253) for details)
179
+ * add support (bugfix) for Mongoid >= 5.0 (see [issue #277](https://github.com/aasm/aasm/issues/277) and [issue #278](https://github.com/aasm/aasm/issues/278) for details)
180
+
181
+ ## 4.3.0
182
+
183
+ * add support for multiple state machines per class (see [issue #158](https://github.com/aasm/aasm/issues/158) and [issue #240](https://github.com/aasm/aasm/issues/240) for details)
184
+ * special thanks to [@evadne](https://github.com/evadne) for testing this feature, and providing comments and patches (see [issue #245](https://github.com/aasm/aasm/issues/245) for details)
185
+
186
+ ## 4.2.0
187
+
188
+ * support turning off and on the configuration option for `no_direct_assignment` (see [issue #223](https://github.com/aasm/aasm/issues/223) for details)
189
+ * event arguments are now passed to `:after_commit` callbacks as well (see [issue #238](https://github.com/aasm/aasm/pull/238), thanks to [@kuinak](https://github.com/kuinak))
190
+
191
+ ## 4.1.1
192
+
193
+ * support block notation for `:after_commit` event callbacks (see [issue #224](https://github.com/aasm/aasm/issues/224) for details)
194
+ * event arguments are now passed to state callbacks as well (not only to event callbacks) (see [issue #219](https://github.com/aasm/aasm/issues/219), thanks to [@tobithiel](https://github.com/tobithiel))
195
+ * `AASM::InvalidTransition` now references the current object (with the state machine) and the _AASM_ event name (see [issue #217](https://github.com/aasm/aasm/issues/217), thanks to [@awsmsrc](https://github.com/awsmsrc))
196
+ * bugfix: do not update unloaded state for [Sequel](http://sequel.jeremyevans.net/) (see [issue #218](https://github.com/aasm/aasm/issues/218), thanks to [@godfat](https://github.com/godfat))
197
+
198
+ ## 4.1.0
199
+
200
+ * bugfix: initialize the aasm state column after initialization of the _Mongoid_ instance (see [issue #206](https://github.com/aasm/aasm/issues/206), thanks to [@Shwetakale ](https://github.com/Shwetakale ))
201
+ * added support for mongomapper ORM (see [issue #203](https://github.com/aasm/aasm/issues/203), thanks to [@reidmorrison ](https://github.com/reidmorrison ))
202
+ * `aasm_column` has been removed. Use `aasm.attribute_name` instead
203
+ * `aasm_human_event_name` has been removed. Use `aasm.human_event_name` instead
204
+
205
+ ## 4.0.8
206
+
207
+ * bugfix: may_event_name? should return true or false only (see [issue #200](https://github.com/aasm/aasm/issues/200) for details)
208
+
209
+ ## 4.0.7
210
+
211
+ * bugfix: take private methods into account when checking for callbacks (see [issue #197](https://github.com/aasm/aasm/issues/197) for details)
212
+
213
+ ## 4.0.6
214
+
215
+ * bugfix: `false` is treated as uninitialised state (same as `nil`) (see [issue #195](https://github.com/aasm/aasm/issues/195) for details)
216
+ * bugfix: an event's `:error` callback now retrieves all arguments passed to the event (see [issue #196](https://github.com/aasm/aasm/issues/196) for details)
217
+
218
+ ## 4.0.5
219
+
220
+ * bugfix: initialize the aasm state column after initialization of the _ActiveRecord_ instance only if the attribute has been loaded (see [issue #193](https://github.com/aasm/aasm/issues/193) for details)
221
+
222
+ ## 4.0.4
223
+
224
+ * corrected callback order in README
225
+ * bugfix: initialize the aasm state column after initialization of the _ActiveRecord_ instance (see [issue #191](https://github.com/aasm/aasm/issues/191) for details)
226
+ * bugfix: avoid Rails autoloading conflicts (see [issue #137](https://github.com/aasm/aasm/issues/137) and [issue #139](https://github.com/aasm/aasm/issues/139) for details)
227
+
228
+ ## 4.0.3
229
+
230
+ * bugfix: fire guards only once per transition, part 2 (see [issue #187](https://github.com/aasm/aasm/issues/187) for details)
231
+ * `aasm_column` is deprecated. Use `aasm.attribute_name` instead
232
+
233
+ ## 4.0.2
234
+
235
+ * bugfix: really support block-guards (defined within a transition block) (see [issue #186](https://github.com/aasm/aasm/issues/186) for details)
236
+
237
+ ## 4.0.1
238
+
239
+ * fire guards only once per transition (see [issue #184](https://github.com/aasm/aasm/issues/184) for details)
240
+ * `aasm_human_event_name` is deprecated, use `aasm.human_event_name` instead
241
+
242
+ ## 4.0.0
243
+
244
+ * support `if` and `unless` guard syntax: (see [issue #179](https://github.com/aasm/aasm/issues/179) and [issue #181](https://github.com/aasm/aasm/issues/181)), thanks to [@bigtunacan](https://github.com/bigtunacan)
245
+ * may configure to not allow direct assignment for persisted AASM models (see [issue #53](https://github.com/aasm/aasm/issues/53))
246
+ * **DSL change**: callbacks don't require `to_state` parameter anymore, but still support it
247
+ (closing issues
248
+ [#11](https://github.com/aasm/aasm/issues/11),
249
+ [#58](https://github.com/aasm/aasm/issues/58) and
250
+ [#80](https://github.com/aasm/aasm/issues/80)
251
+ thanks to [@ejlangev](https://github.com/ejlangev))
252
+ * **DSL change**: `after_commit` hooks are now event-based (see [issue #112](https://github.com/aasm/aasm/issues/112))
253
+ * **DSL change**: event and state callbacks have been re-ordered; state callbacks are not run anymore if any guard fails
254
+ * **DSL change**: `:on_transition` renamed to `:after`
255
+ * **DSL change**: `:on_transition` renamed to `:after`
256
+ * **DSL change**: transition `:after` binding changed (see [issue #59](https://github.com/aasm/aasm/issues/59), thanks to [@stiff](https://github.com/stiff))
257
+ * **DSL change**: instance-based events inspection now returns event instances (instead of the event names as symbol)
258
+ * **DSL change**: instance-based permissible_events has been removed in favor or events(:permissible => true)
259
+ * **DSL change**: class-based events now returns a list of Event instances (instead of a hash with event names as keys)
260
+ * **DSL change**: renamed permissible states and events to permitted states events
261
+ * removed deprecated methods (mostly the ones prefixed with `aasm_`)
262
+
263
+ ## 3.4.0
264
+
265
+ * allow retrieving the current event (`aasm.current_event`) (see [issue #159](https://github.com/aasm/aasm/issues/159) and [issue #168](https://github.com/aasm/aasm/issues/168))
266
+
267
+ ## 3.3.3
268
+
269
+ * bugfix: support reloading development environment in Rails (see [issue #148](https://github.com/aasm/aasm/issues/148))
270
+
271
+ ## 3.3.2
272
+
273
+ * bugfix: avoid conflicts with `failed` and `fired` event names (see [issue #157](https://github.com/aasm/aasm/issues/157)), thanks to [@MichaelXavier](https://github.com/MichaelXavier)
274
+ * bugfix: not using transactions unless saving to the database (see [issue #162](https://github.com/aasm/aasm/issues/162) and [issue #164](https://github.com/aasm/aasm/issues/164)), thanks to [@roberthoner](https://github.com/roberthoner)
275
+ * bugfix: `after_commit` should only run if saving to the database (see [issue #151](https://github.com/aasm/aasm/issues/151)), thanks to [@ivantsepp](https://github.com/ivantsepp)
276
+
277
+ ## 3.3.1
278
+
279
+ * bugfix: permissible events will respect given `guards` (see [issue #150](https://github.com/aasm/aasm/issues/150))
280
+
281
+ ## 3.3.0
282
+
283
+ * support for Rails 4.1 enum fields (see [issue #124](https://github.com/aasm/aasm/issues/124), thanks to [@bkon](https://github.com/bkon))
284
+ * bugfix: allow lazy-evaluation for Rails 3 scopes (see [issue #144](https://github.com/aasm/aasm/issues/144), thanks to [@laurens](https://github.com/laurens))
285
+
286
+ ## 3.2.1
287
+
288
+ * bugfix: permissible_events and events did not contain events with an empty "from" transition (see [issue #140](https://github.com/aasm/aasm/issues/140) and [issue #141](https://github.com/aasm/aasm/issues/141), thanks to [@daniel-rikowski](https://github.com/daniel-rikowski))
289
+
290
+ ## 3.2.0
291
+
292
+ * support [Sequel](http://sequel.jeremyevans.net/) (see [issue #119](https://github.com/aasm/aasm/issues/119), thanks to [@godfat](https://github.com/godfat))
293
+ * may not fire an unknown event (see [issue #128](https://github.com/aasm/aasm/issues/128)
294
+
295
+ ## 3.1.1
296
+
297
+ * bugfix: don't require ActiveRecord for localizing AASM event and state name (see [issue #113](https://github.com/aasm/aasm/issues/113), thanks to [@silentshade](https://github.com/silentshade))
298
+
299
+ ## 3.1.0
300
+
301
+ * validating the current state (see [issue #95](https://github.com/aasm/aasm/issues/95), thanks to [@ivantsepp](https://github.com/ivantsepp))
302
+ * allow configuring behavior of nested transactions (see [issue #107](https://github.com/aasm/aasm/issues/107))
303
+ * support multiple guards per transition
304
+ * support event guards (see [issue #85](https://github.com/aasm/aasm/issues/85))
305
+ * support reading from- and to-state during on_transition callback (see [issue #100](https://github.com/aasm/aasm/issues/100))
306
+
307
+ ## 3.0.26
308
+
309
+ * support state.human_name (aliased to state.localized_name) (see [issue #105](https://github.com/aasm/aasm/issues/105))
310
+
311
+ ## 3.0.25
312
+
313
+ * initialize the state even if validation is skipped (for ActiveRecord and Mongoid persistence) (see [issue #103](https://github.com/aasm/aasm/issues/103), thanks to [@vfonic](https://github.com/vfonic) and [@aaronklaassen](https://github.com/aaronklaassen))
314
+
315
+ ## 3.0.24
316
+
317
+ * added support for event blocks (thanks to [@Intrepidd](https://github.com/Intrepidd))
318
+
319
+ ## 3.0.23
320
+
321
+ * added support for `after_commit` callback (transaction support) (thanks to [@tisba](https://github.com/tisba))
322
+
323
+ ## 3.0.22
324
+
325
+ * fixed [issue 88](https://github.com/aasm/aasm/issues/88): wrong number of arguments for transaction method
326
+
327
+ ## 3.0.21
328
+
329
+ * support nested ActiveRecord transactions ([@ozeias](https://github.com/ozeias))
330
+ * allow overwriting of events, can be very useful with inheritance ([@Intrepidd](https://github.com/Intrepidd))
331
+
332
+ ## 3.0.20
333
+
334
+ * added configuration option to disable automatic scope creation
335
+
336
+ ## 3.0.19
337
+
338
+ * fixed deprecation warning with *Rails 4* (`Relation#update_all` with conditions is deprecated)
339
+ * fixing [issue #69](https://github.com/aasm/aasm/issues/69) ( *ActiveRecord* scopes are not chainable)
340
+
341
+ ## 3.0.18
342
+
343
+ * fixing [issue #66](https://github.com/aasm/aasm/issues/66) (state methods not reflecting the current state)
344
+
345
+ ## 3.0.17
346
+
347
+ * supporting instance level inspection for states (including permissible state, see [issue #54](https://github.com/aasm/aasm/issues/54))
348
+ * added autocreation of constants for each state ([@jherdman](https://github.com/jherdman))
349
+
350
+ ## 3.0.16
351
+
352
+ * added autocreation of state scopes for Mongoid (thanks to [@jonnyshields](https://github.com/johnnyshields))
353
+
354
+ ## 3.0.15
355
+
356
+ * added support for localized state names (on a class level, like `Record.aasm.states.map(&:localized_name)`)
357
+
358
+ ## 3.0.14
359
+
360
+ * supporting event inspection for to-states transitions (`Event#transitions_to_state?`)
361
+
362
+ ## 3.0.13
363
+
364
+ * supporting *ActiveRecord* transactions when firing an event
365
+
366
+ ## 3.0.12
367
+
368
+ * `aasm_from_states_for_state` now supports to filter for specific transition
369
+
370
+ ## 3.0.11
371
+
372
+ * added class method `aasm_from_states_for_state` to retrieve all from states (regarding transitions) for a given state
373
+
374
+ ## 3.0.10
375
+
376
+ * added support for transitions from all other states (thanks to [@swrobel](https://github.com/swrobel))
377
+
378
+ ## 3.0.9
379
+
380
+ * guard checks (e.g. `may_edit?`) now support guard parameters as well
381
+
382
+ ## 3.0.8
383
+
384
+ * fixed issue with generating docs using yard
385
+
386
+ ## 3.0.7
387
+
388
+ * removed deprecation warning when localizing aasm state names (look at [issue #38](https://github.com/rubyist/aasm/issues/38) for details)
389
+
390
+ ## 3.0.6
391
+
392
+ * bugfix: if configured to skip validation the code does not validate anymore
393
+
394
+ ## 3.0.5
395
+
396
+ * bugfix: get rid of error with old rubygems versions
397
+
398
+ ## 3.0.4
399
+
400
+ * bugfix: Subclasses of aasm-enabled classes don't lose settings anymore (thanks to codez)
401
+
402
+ ## 3.0.3
403
+
404
+ * bugfix: ActiveRecord scopes are generated when using the new DSL
405
+
406
+ ## 3.0.2
407
+
408
+ * ActiveRecord persistence can ignore validation when trying to save invalid models
409
+
410
+ ## 3.0.1
411
+
412
+ * added support for Mongoid (Thanks, Michał Taberski)
413
+
414
+ ## 3.0.0
415
+
416
+ * switched documentation to the new DSL
417
+ * whiny transactions: by default, raise an exception if an event transition is not possible
418
+ * you may disable whiny transactions
419
+
420
+ ## 2.4.0
421
+
422
+ * supporting new DSL (which is much shorter)
423
+
424
+ ## 2.3.1
425
+
426
+ * bugfix: avoid naming conflict with i18n
427
+
428
+ ## 2.3.0
429
+
430
+ * supporting i18n
431
+ * supporting regular expressions for hash values and strings