Skip to content

clgiovannelli/paper_trail_background

 
 

Repository files navigation

paper_trail_background

  • Build
  • Downloads
  • Version

Allows you to enqueue version creation/deletion as a background job to avoid having business logic blocked by changelog writing.

Using

First you'll need to setup a job for processing versions:

# The class MUST be named this
class VersionJob < ApplicationJob

  # These are settings you'll probably want, I suggest sidekiq-unique-jobs
  sidekiq_options(
    :queue => "versions",
    :unique_across_queues => true,
    :lock => :until_executed,
    :log_duplicate_payload => true
  )

  # This wires up the background job
  include PaperTrail::Background::Sidekiq
end

Installing

Run this command in your project:

$ bundle add paper_trail_background

Or install it yourself with:

$ gem install paper_trail_background

Contributing

  1. Read the Code of Conduct
  2. Fork it
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

Todo

  • Support other job types
  • Allow for configuring the job class name

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 80.3%
  • HTML 14.4%
  • JavaScript 3.1%
  • CSS 1.9%
  • Shell 0.3%