Module: Draper::Compatibility::GlobalID
- Extended by:
- ActiveSupport::Concern
- Included in:
- Decorator
- Defined in:
- lib/draper/compatibility/global_id.rb
Overview
Active Job allows you to pass ActiveRecord objects to background tasks directly and performs the necessary serialization and deserialization. In order to do this, arguments to a background job must implement Global ID.
This compatibility patch implements Global ID for decorated objects by defining .find(id)
class method that uses the original one and decorates the result.
This means you can pass decorated objects to background jobs and they will be decorated when
deserialized.