Skip to content

Commit

Permalink
Deprecate GoodJob.v4_ready?
Browse files Browse the repository at this point in the history
If you're reading this deprecation you're already all good (:
  • Loading branch information
Earlopain committed Jul 8, 2024
1 parent 76ddc35 commit 45442ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/good_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ def self.perform_inline(queue_string = "*", limit: nil)
# Tests whether GoodJob can be safely upgraded to v4
# @return [Boolean]
def self.v4_ready?
GoodJob.deprecator.warn(<<~MSG)
Calling `GoodJob.v4_ready?` is deprecated and will be removed in GoodJob v5.
If you are reading this deprecation you are already on v4.
MSG
true
end

Expand Down
2 changes: 2 additions & 0 deletions spec/lib/good_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ def perform(succeed: true)

describe '#v4_ready?' do
it "is true" do
allow(GoodJob.deprecator).to receive(:warn)
expect(described_class.v4_ready?).to eq true
expect(GoodJob.deprecator).to have_received(:warn)
end
end
end

0 comments on commit 45442ae

Please sign in to comment.