journaled 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +42 -6
  3. data/Rakefile +7 -1
  4. data/app/jobs/journaled/application_job.rb +4 -0
  5. data/app/jobs/journaled/delivery_job.rb +96 -0
  6. data/app/models/concerns/journaled/changes.rb +5 -5
  7. data/app/models/journaled/change.rb +3 -0
  8. data/app/models/journaled/change_writer.rb +1 -0
  9. data/app/models/journaled/delivery.rb +5 -2
  10. data/app/models/journaled/event.rb +5 -2
  11. data/app/models/journaled/writer.rb +10 -8
  12. data/lib/journaled.rb +26 -5
  13. data/lib/journaled/engine.rb +5 -0
  14. data/lib/journaled/relation_change_protection.rb +1 -1
  15. data/lib/journaled/version.rb +1 -1
  16. data/spec/dummy/config/application.rb +1 -2
  17. data/spec/dummy/config/database.yml +4 -19
  18. data/spec/dummy/config/environments/development.rb +0 -13
  19. data/spec/dummy/config/environments/test.rb +3 -5
  20. data/spec/dummy/db/schema.rb +3 -16
  21. data/spec/jobs/journaled/delivery_job_spec.rb +221 -0
  22. data/spec/lib/journaled_spec.rb +39 -0
  23. data/spec/models/concerns/journaled/changes_spec.rb +11 -0
  24. data/spec/models/database_change_protection_spec.rb +19 -25
  25. data/spec/models/journaled/change_writer_spec.rb +5 -0
  26. data/spec/models/journaled/delivery_spec.rb +33 -0
  27. data/spec/models/journaled/event_spec.rb +23 -16
  28. data/spec/models/journaled/writer_spec.rb +34 -18
  29. data/spec/rails_helper.rb +1 -2
  30. data/spec/spec_helper.rb +1 -3
  31. metadata +38 -62
  32. data/config/routes.rb +0 -2
  33. data/lib/journaled/job_priority.rb +0 -5
  34. data/spec/dummy/config/environments/production.rb +0 -78
  35. data/spec/dummy/config/initializers/assets.rb +0 -8
  36. data/spec/dummy/db/migrate/20180606205114_create_delayed_jobs.rb +0 -18
  37. data/spec/dummy/log/development.log +0 -29
  38. data/spec/dummy/log/test.log +0 -2482
  39. data/spec/support/delayed_job_spec_helper.rb +0 -11
@@ -1,11 +0,0 @@
1
- module DelayedJobSpecHelper
2
- def with_jobs_delayed(opts = {})
3
- work_off = opts.fetch(:work_off, true)
4
- original = Delayed::Worker.delay_jobs
5
- Delayed::Worker.delay_jobs = true
6
- yield
7
- ensure
8
- Delayed::Worker.delay_jobs = original
9
- Delayed::Worker.new.work_off if work_off
10
- end
11
- end