Skip to content

Commit

Permalink
feat: use global constant of Rails
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgz committed Oct 31, 2024
1 parent 3d9c6d0 commit 24f6a29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lepus/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Railtie < ::Rails::Railtie
initializer "lepus.app_executor", before: :run_prepare_callbacks do |app|
config.lepus.app_executor ||= app.executor
if ::Rails.respond_to?(:error) && config.lepus.on_thread_error.nil?
config.lepus.on_thread_error = ->(exception) { Rails.error.report(exception, handled: false) }
config.lepus.on_thread_error = ->(exception) { ::Rails.error.report(exception, handled: false) }
elsif config.lepus.on_thread_error.nil?
config.lepus.on_thread_error = ->(exception) { Lepus.logger.error(exception) }
end
Expand Down
2 changes: 1 addition & 1 deletion lib/lepus/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def boot
begin
require "rails"
require_relative "rails"
require File.expand_path("config/environment", Dir.pwd)
Kernel.require File.expand_path("config/environment", Dir.pwd)
rescue LoadError
# Rails not found
end
Expand Down

0 comments on commit 24f6a29

Please sign in to comment.