Skip to content

Commit

Permalink
Conditionally defined method for priority
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Aug 13, 2024
1 parent ab6e6e8 commit 524a159
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/rspec/rails/matchers/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,14 @@ def job_matches?(job)
end

# Rails 6.1 serializes the priority with a string key
def fetch_priority(job)
job[:priority] || job['priority']
if ::Rails.version.to_f >= 7
def fetch_priority(job)
job[:priority]
end
else
def fetch_priority(job)
job['priority']
end
end

def arguments_match?(job)
Expand Down

0 comments on commit 524a159

Please sign in to comment.