Skip to content

Commit 8fb2396

Browse files
committed
release notes: iteration over the description of Global ID [ci skip]
1 parent 5ac824e commit 8fb2396

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

guides/source/4_2_release_notes.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,23 @@ Jobs written with the Active Job API run on any of the supported queues thanks
4141
to their respective adapters. Active Job comes pre-configured with an inline
4242
runner that executes jobs right away.
4343

44-
Jobs often need to take Active Record objects as arguments, but we can't pass
45-
fully-marshaled Ruby objects through many queueing systems. Active Job passes
44+
Jobs often need to take Active Record objects as arguments. Active Job passes
4645
object references as URIs (uniform resource identifiers) instead of marshaling
4746
the object itself. The new [Global ID](https://github.com/rails/globalid)
4847
library builds URIs and looks up the objects they reference. Passing Active
49-
Record objects as job arguments "just works:" Active Job passes a reference to
50-
the object, then looks up the object from its reference.
48+
Record objects as job arguments just works by using Global ID internally.
49+
50+
For example, if `trashable` is an AR this job runs just fine
51+
52+
```ruby
53+
class TrashableCleanupJob < ActiveJob::Base
54+
def perform(trashable, depth)
55+
trashable.cleanup(depth)
56+
end
57+
end
58+
```
59+
60+
with no serialization involved.
5161

5262
See the [Active Job Basics](active_job_basics.html) guide for more
5363
information.

0 commit comments

Comments
 (0)