active_interaction 1.4.1 → 2.0.0

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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +65 -3
  3. data/CONTRIBUTING.md +19 -0
  4. data/README.md +1121 -180
  5. data/lib/active_interaction/backports.rb +58 -13
  6. data/lib/active_interaction/base.rb +16 -52
  7. data/lib/active_interaction/concerns/active_recordable.rb +57 -0
  8. data/lib/active_interaction/concerns/runnable.rb +4 -14
  9. data/lib/active_interaction/errors.rb +14 -66
  10. data/lib/active_interaction/filters/array_filter.rb +12 -9
  11. data/lib/active_interaction/filters/file_filter.rb +5 -24
  12. data/lib/active_interaction/filters/hash_filter.rb +11 -13
  13. data/lib/active_interaction/filters/interface_filter.rb +2 -2
  14. data/lib/active_interaction/filters/{model_filter.rb → object_filter.rb} +6 -6
  15. data/lib/active_interaction/locale/en.yml +1 -1
  16. data/lib/active_interaction/modules/validation.rb +2 -2
  17. data/lib/active_interaction/version.rb +1 -1
  18. data/lib/active_interaction.rb +25 -13
  19. data/spec/active_interaction/base_spec.rb +15 -39
  20. data/spec/active_interaction/concerns/active_recordable_spec.rb +51 -0
  21. data/spec/active_interaction/concerns/runnable_spec.rb +2 -34
  22. data/spec/active_interaction/errors_spec.rb +6 -89
  23. data/spec/active_interaction/filters/array_filter_spec.rb +2 -2
  24. data/spec/active_interaction/filters/file_filter_spec.rb +4 -4
  25. data/spec/active_interaction/filters/hash_filter_spec.rb +1 -17
  26. data/spec/active_interaction/filters/{model_filter_spec.rb → object_filter_spec.rb} +17 -17
  27. data/spec/active_interaction/i18n_spec.rb +1 -2
  28. data/spec/active_interaction/integration/array_interaction_spec.rb +10 -0
  29. data/spec/active_interaction/integration/hash_interaction_spec.rb +12 -2
  30. data/spec/active_interaction/integration/interface_interaction_spec.rb +10 -1
  31. data/spec/active_interaction/integration/object_interaction_spec.rb +16 -0
  32. data/spec/active_interaction/modules/validation_spec.rb +1 -2
  33. metadata +32 -29
  34. data/lib/active_interaction/concerns/transactable.rb +0 -79
  35. data/spec/active_interaction/concerns/transactable_spec.rb +0 -135
  36. data/spec/active_interaction/integration/model_interaction_spec.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3886f47131ea3b818d3c1aac281179e65975a76
4
- data.tar.gz: adef81de6b569a05c85e4ffd59f2389836c1b5f9
3
+ metadata.gz: ec03f8a492e5db88366e50b9a918ff40a4e008b3
4
+ data.tar.gz: 356b91990bfac14981a6d36dffcaafb4e3dd2d33
5
5
  SHA512:
6
- metadata.gz: 24989fa80ee14abcc56ddaa2b1c52c2c35286685d0fd27db0accc282581e598064e88cfb4898484a93327d23ebae246c50d415e4793a561d83f3b0e437bba808
7
- data.tar.gz: cb5b99e7bd5eca69ccfc75583edcc58a45ef5fa5b08340f17c0b52b5e0f3e6457839784e85c291e506ac154f7367e609917869697bc109684c971e0f62d818e6
6
+ metadata.gz: a68094094d6dbf8a395a3f709ffd993944512c6edc921ce36f99b4383792de041954cc2d73271a0748102782f89c4e457bb63288ee56eb34e42ff6cb38fbcbd5
7
+ data.tar.gz: d682f33e94ea7bd25f4f9cf89e2fe3924bc501e608c6d32f469da42d92782f88aca01b43605c69adb5de62e36b2cafe3857307ff927a2306dbbb25ef334c4f93
data/CHANGELOG.md CHANGED
@@ -1,4 +1,52 @@
1
- # [Master][]
1
+ # [2.0.0][] (2015-05-06)
2
+
3
+ ## Changed
4
+
5
+ - [#250][]: Replaced symbolic errors with Rails 5-style detailed errors.
6
+ - [#269][]: Prevented proc defaults from being eagerly evaluated.
7
+ - [#264][]: Renamed `model` filter to `object`.
8
+ - [#213][]: Remove transaction support. Database transactions will need to be
9
+ handled manually now.
10
+ - [#214][]: Results are returned from invalid outcomes.
11
+ - [#164][]: Changed the `hash` filter to use hashes with indifferent access.
12
+ - [#236][]: Changed the `file` filter to accept anything that responds to `eof?`.
13
+
14
+ ## Security
15
+
16
+ - [#215][]: Rather than symbolizing keys all hashes now use indifferent access.
17
+ This takes care of potential but unlikely DoS attacks noted in [#163][].
18
+
19
+ # [1.6.0][] (2015-05-06)
20
+
21
+ ## Added
22
+
23
+ - Added `object` as an alias for `model`.
24
+ - Added symbol support to `add`.
25
+ - Added `details` as an alternative to `symbolic`.
26
+
27
+ ## Changed
28
+
29
+ - Deprecated `model` in favor of `object`.
30
+ - Deprecated `add_sym` in favor of `add`.
31
+ - Deprecated `transaction`.
32
+ - Deprecated `symbolic` in favor of `details`.
33
+
34
+ # [1.5.1][] (2015-04-28)
35
+
36
+ ## Fixed
37
+
38
+ - [#265][]: Allow `nil` inputs for interface and model filters.
39
+ - [#256][]: Improve error messages for nested invalid values.
40
+
41
+ # [1.5.0][] (2015-02-05)
42
+
43
+ ## Added
44
+
45
+ - [#248][]: Add `has_attribute?` support to an instance of an interaction.
46
+
47
+ ## Fixed
48
+
49
+ - [#248][]: Fix support for simple_form gem.
2
50
 
3
51
  # [1.4.1][] (2014-12-12)
4
52
 
@@ -366,7 +414,10 @@
366
414
 
367
415
  - Initial release.
368
416
 
369
- [master]: https://github.com/orgsync/active_interaction/compare/v1.4.1...master
417
+ [2.0.0]: https://github.com/orgsync/active_interaction/compare/v1.6.0...v2.0.0
418
+ [1.6.0]: https://github.com/orgsync/active_interaction/compare/v1.5.1...v1.6.0
419
+ [1.5.1]: https://github.com/orgsync/active_interaction/compare/v1.5.0...v1.5.1
420
+ [1.5.0]: https://github.com/orgsync/active_interaction/compare/v1.4.1...v1.5.0
370
421
  [1.4.1]: https://github.com/orgsync/active_interaction/compare/v1.4.0...v1.4.1
371
422
  [1.4.0]: https://github.com/orgsync/active_interaction/compare/v1.3.1...v1.4.0
372
423
  [1.3.1]: https://github.com/orgsync/active_interaction/compare/v1.3.0...v1.3.1
@@ -409,7 +460,7 @@
409
460
  [0.1.3]: https://github.com/orgsync/active_interaction/compare/v0.1.2...v0.1.3
410
461
  [0.1.2]: https://github.com/orgsync/active_interaction/compare/v0.1.1...v0.1.2
411
462
  [0.1.1]: https://github.com/orgsync/active_interaction/compare/v0.1.0...v0.1.1
412
- [0.1.0]: https://github.com/orgsync/active_interaction/compare/62f999b...v0.1.0
463
+ [0.1.0]: https://github.com/orgsync/active_interaction/compare/v0.0.0...v0.1.0
413
464
 
414
465
  [#20]: https://github.com/orgsync/active_interaction/issues/20
415
466
  [#23]: https://github.com/orgsync/active_interaction/issues/23
@@ -466,6 +517,7 @@
466
517
  [#155]: https://github.com/orgsync/active_interaction/issues/155
467
518
  [#156]: https://github.com/orgsync/active_interaction/issues/156
468
519
  [#163]: https://github.com/orgsync/active_interaction/issues/163
520
+ [#164]: https://github.com/orgsync/active_interaction/issues/164
469
521
  [#165]: https://github.com/orgsync/active_interaction/issues/165
470
522
  [#173]: https://github.com/orgsync/active_interaction/issues/173
471
523
  [#174]: https://github.com/orgsync/active_interaction/issues/174
@@ -478,7 +530,17 @@
478
530
  [#203]: https://github.com/orgsync/active_interaction/issues/203
479
531
  [#206]: https://github.com/orgsync/active_interaction/issues/206
480
532
  [#207]: https://github.com/orgsync/active_interaction/issues/207
533
+ [#213]: https://github.com/orgsync/active_interaction/issues/213
534
+ [#214]: https://github.com/orgsync/active_interaction/issues/214
535
+ [#215]: https://github.com/orgsync/active_interaction/issues/215
481
536
  [#224]: https://github.com/orgsync/active_interaction/issues/224
482
537
  [#235]: https://github.com/orgsync/active_interaction/issues/235
538
+ [#236]: https://github.com/orgsync/active_interaction/issues/236
483
539
  [#239]: https://github.com/orgsync/active_interaction/issues/239
484
540
  [#244]: https://github.com/orgsync/active_interaction/issues/244
541
+ [#248]: https://github.com/orgsync/active_interaction/issues/248
542
+ [#250]: https://github.com/orgsync/active_interaction/issues/250
543
+ [#256]: https://github.com/orgsync/active_interaction/issues/256
544
+ [#264]: https://github.com/orgsync/active_interaction/issues/264
545
+ [#265]: https://github.com/orgsync/active_interaction/issues/265
546
+ [#269]: https://github.com/orgsync/active_interaction/issues/269
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,19 @@
1
+ # Steps
2
+
3
+ 1. [Fork][] the repo.
4
+ 2. Add a breaking test for your change.
5
+ 3. Make the tests pass.
6
+ 4. Push your fork.
7
+ 5. Submit a pull request.
8
+
9
+ # Code Style
10
+
11
+ Running the tests using `rake` (with no args) or within `guard` will also check for style issues in the code. Ideally all submissions would pass these checks. If the code style is causing issues (particularly the method or class size) we can work with you to correct it. Don't let it stop you from contributing.
12
+
13
+ # Vagrant
14
+
15
+ If you like to use [Vagrant][] we've provided a [Vagrantfile][] for your convenience.
16
+
17
+ [fork]: https://github.com/orgsync/active_interaction/fork
18
+ [Vagrant]: http://www.vagrantup.com
19
+ [Vagrantfile]: Vagrantfile