Skip to content

Commit

Permalink
Fix a few issues (#44)
Browse files Browse the repository at this point in the history
* Inherit the deprecation behavior from the application
* Always register Uncruft's deprecator
  • Loading branch information
rzane authored Jan 29, 2025
1 parent fbe2e35 commit 5b77e47
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
uncruft (0.7.0)
uncruft (0.7.1)
railties (>= 6.1.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6_1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
uncruft (0.7.0)
uncruft (0.7.1)
railties (>= 6.1.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7_0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
uncruft (0.7.0)
uncruft (0.7.1)
railties (>= 6.1.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7_1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
uncruft (0.7.0)
uncruft (0.7.1)
railties (>= 6.1.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7_2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
uncruft (0.7.0)
uncruft (0.7.1)
railties (>= 6.1.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_8_0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
uncruft (0.7.0)
uncruft (0.7.1)
railties (>= 6.1.0)

GEM
Expand Down
12 changes: 8 additions & 4 deletions lib/uncruft/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ class Railtie < ::Rails::Railtie
strategies.unshift(DeprecationHandler.new)
config.active_support.deprecation = strategies
end
end

if Rails.gem_version >= Gem::Version.new('7.1')
initializer "uncruft.deprecator" do |app|
app.deprecators[:uncruft] = Uncruft.deprecator
end
if Rails.gem_version >= Gem::Version.new('7.1')
initializer "uncruft.deprecator" do |app|
app.deprecators[:uncruft] = Uncruft.deprecator
end
end

initializer 'uncruft.deprecator.behavior' do |app|
Uncruft.deprecator.behavior = app.config.active_support.deprecation
end
end
end
2 changes: 1 addition & 1 deletion lib/uncruft/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Uncruft
VERSION = '0.7.0'
VERSION = '0.7.1'
end

0 comments on commit 5b77e47

Please sign in to comment.