mongoid-history 0.6.1 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +5 -5
  2. data/.coveralls.yml +1 -1
  3. data/.document +5 -5
  4. data/.github/workflows/test.yml +72 -0
  5. data/.gitignore +46 -46
  6. data/.rspec +2 -2
  7. data/.rubocop.yml +6 -6
  8. data/.rubocop_todo.yml +99 -92
  9. data/CHANGELOG.md +173 -130
  10. data/CONTRIBUTING.md +117 -118
  11. data/Dangerfile +1 -1
  12. data/Gemfile +49 -35
  13. data/LICENSE.txt +20 -20
  14. data/README.md +609 -531
  15. data/RELEASING.md +66 -0
  16. data/Rakefile +24 -24
  17. data/UPGRADING.md +53 -0
  18. data/lib/mongoid/history/attributes/base.rb +72 -72
  19. data/lib/mongoid/history/attributes/create.rb +45 -50
  20. data/lib/mongoid/history/attributes/destroy.rb +34 -34
  21. data/lib/mongoid/history/attributes/update.rb +104 -43
  22. data/lib/mongoid/history/options.rb +177 -184
  23. data/lib/mongoid/history/trackable.rb +588 -501
  24. data/lib/mongoid/history/tracker.rb +247 -238
  25. data/lib/mongoid/history/version.rb +5 -5
  26. data/lib/mongoid/history.rb +77 -52
  27. data/lib/mongoid-history.rb +1 -1
  28. data/mongoid-history.gemspec +25 -25
  29. data/perf/benchmark_modified_attributes_for_create.rb +65 -0
  30. data/perf/gc_suite.rb +21 -0
  31. data/spec/integration/embedded_in_polymorphic_spec.rb +112 -135
  32. data/spec/integration/integration_spec.rb +976 -936
  33. data/spec/integration/multi_relation_spec.rb +47 -53
  34. data/spec/integration/multiple_trackers_spec.rb +68 -0
  35. data/spec/integration/nested_embedded_documents_spec.rb +64 -84
  36. data/spec/integration/nested_embedded_documents_tracked_in_parent_spec.rb +124 -0
  37. data/spec/integration/nested_embedded_polymorphic_documents_spec.rb +115 -127
  38. data/spec/integration/subclasses_spec.rb +47 -29
  39. data/spec/integration/track_history_order_spec.rb +84 -0
  40. data/spec/integration/validation_failure_spec.rb +76 -0
  41. data/spec/spec_helper.rb +32 -25
  42. data/spec/support/error_helpers.rb +7 -0
  43. data/spec/support/mongoid.rb +11 -11
  44. data/spec/support/mongoid_history.rb +12 -13
  45. data/spec/unit/attributes/base_spec.rb +141 -150
  46. data/spec/unit/attributes/create_spec.rb +342 -315
  47. data/spec/unit/attributes/destroy_spec.rb +228 -218
  48. data/spec/unit/attributes/update_spec.rb +342 -210
  49. data/spec/unit/callback_options_spec.rb +165 -0
  50. data/spec/unit/embedded_methods_spec.rb +87 -69
  51. data/spec/unit/history_spec.rb +58 -35
  52. data/spec/unit/my_instance_methods_spec.rb +555 -485
  53. data/spec/unit/options_spec.rb +365 -326
  54. data/spec/unit/singleton_methods_spec.rb +406 -338
  55. data/spec/unit/store/default_store_spec.rb +11 -11
  56. data/spec/unit/store/request_store_spec.rb +13 -13
  57. data/spec/unit/trackable_spec.rb +1057 -586
  58. data/spec/unit/tracker_spec.rb +190 -163
  59. metadata +25 -10
  60. data/.travis.yml +0 -35
@@ -1,11 +1,11 @@
1
- require 'spec_helper'
2
-
3
- describe 'Default Store' do
4
- describe 'Mongoid::History' do
5
- describe '.store' do
6
- it 'should return Thread object' do
7
- expect(Mongoid::History.store).to be_a Thread
8
- end
9
- end
10
- end
11
- end
1
+ require 'spec_helper'
2
+
3
+ describe 'Default Store' do
4
+ describe 'Mongoid::History' do
5
+ describe '.store' do
6
+ it 'should return Thread object' do
7
+ expect(Mongoid::History.store).to be_a Thread
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,13 +1,13 @@
1
- require 'spec_helper'
2
-
3
- describe 'RequestStore' do
4
- before { stub_const('RequestStore', RequestStoreTemp) }
5
-
6
- describe 'Mongoid::History' do
7
- describe '.store' do
8
- it 'should return RequestStore' do
9
- expect(Mongoid::History.store).to be_a Hash
10
- end
11
- end
12
- end
13
- end
1
+ require 'spec_helper'
2
+
3
+ describe 'RequestStore' do
4
+ before { stub_const('RequestStore', RequestStoreTemp) }
5
+
6
+ describe 'Mongoid::History' do
7
+ describe '.store' do
8
+ it 'should return RequestStore' do
9
+ expect(Mongoid::History.store).to be_a Hash
10
+ end
11
+ end
12
+ end
13
+ end