lib/good_job.rb in good_job-4.0.1 vs lib/good_job.rb in good_job-4.0.2
- old
+ new
@@ -267,23 +267,24 @@
end
# Tests whether GoodJob can be safely upgraded to v4
# @return [Boolean]
def self.v4_ready?
- GoodJob::Job.discrete_support? && GoodJob::Job.where(finished_at: nil).where(is_discrete: [nil, false]).none?
+ 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
# Deprecator for providing deprecation warnings.
# @return [ActiveSupport::Deprecation]
def self.deprecator
@_deprecator ||= begin
next_major_version = GEM_VERSION.segments[0] + 1
ActiveSupport::Deprecation.new("#{next_major_version}.0", "GoodJob")
end
end
-
- include ActiveSupport::Deprecation::DeprecatedConstantAccessor
- deprecate_constant :Lockable, 'GoodJob::AdvisoryLockable', deprecator: deprecator
# Whether all GoodJob migrations have been applied.
# For use in tests/CI to validate GoodJob is up-to-date.
# @return [Boolean]
def self.migrated?