- Extract
performs
into theactive_job-performs
gem with some fixes and extra features, but include it as a dependency.
-
Add
performs
to help cut down Active Job boilerplate.class Post::Publisher < ActiveRecord::AssociatedObject performs :publish, queue_as: :important def publish … end end
The above is the same as writing:
class Post::Publisher < ActiveRecord::AssociatedObject class Job < ApplicationJob; end class PublishJob < Job queue_as :important def perform(publisher, *arguments, **options) publisher.publish(*arguments, **options) end end def publish_later(*arguments, **options) PublishJob.perform_later(self, *arguments, **options) end def publish … end end
See the README for more details.
-
Require a
has_object
call on the record side to associate an object.class Post < ActiveRecord::Base has_object :publisher end
-
Allow
has_object
to pass callbacks onto the associated object.class Post < ActiveRecord::Base has_object :publisher, after_touch: true, before_destroy: :prevent_errant_post_destroy end
- Initial release