Skip to content

Commit

Permalink
Update README to illustrate using named arguments for the unique key. (
Browse files Browse the repository at this point in the history
  • Loading branch information
phallstrom committed Jan 18, 2022
1 parent 055f623 commit b36a011
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ class MyJob < ApplicationJob
# Can be String or Lambda/Proc that is invoked in the context of the job.
# Note: Arguments passed to #perform_later must be accessed through `arguments` method.
key: -> { "Unique-#{arguments.first}" } # MyJob.perform_later("Alice") => "Unique-Alice"
# If the method uses named parameters, they can be accessed like so:
# key: -> { "Unique-#{arguments.first['name']}" } # MyJob.perform_later(name: "Alice")
)
def perform(first_name)
Expand Down

0 comments on commit b36a011

Please sign in to comment.