Skip to content

Commit 63eef09

Browse files
committed
Add a deprecator to SolidQueue module
And include it in the host application's deprecators.
1 parent 5e0586f commit 63eef09

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

lib/solid_queue.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def preserve_finished_jobs?
6969
preserve_finished_jobs
7070
end
7171

72+
def deprecator
73+
@deprecator ||= ActiveSupport::Deprecation.new(next_major_version, "SolidQueue")
74+
end
75+
7276
def instrument(channel, **options, &block)
7377
ActiveSupport::Notifications.instrument("#{channel}.solid_queue", **options, &block)
7478
end

lib/solid_queue/engine.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,9 @@ class Engine < ::Rails::Engine
3737
include ActiveJob::ConcurrencyControls
3838
end
3939
end
40+
41+
initializer "solid_queue.deprecator" do |app|
42+
app.deprecators[:solid_queue] = SolidQueue.deprecator
43+
end
4044
end
4145
end

lib/solid_queue/version.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
module SolidQueue
22
VERSION = "1.2.0"
3+
4+
def self.next_major_version
5+
Gem::Version.new(VERSION).segments.first + 1
6+
end
37
end

0 commit comments

Comments
 (0)