Module: Magic::Presenter::GlobalID

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/magic/presenter/global_id.rb

Overview

Active Job integration

Active Job [accepts Active Record objects]( edgeguides.rubyonrails.org/active_job_basics.html#globalid ). An object passed to a background job must implement [Global ID]( github.com/rails/globalid ).

This module implements Global ID for decorated models by defining ‘.find` method that uses the one from a model class and decorates the result. This means one can pass decorated objects to background jobs and get them decorated when deserialized.