Skip to content

Instantly share code, notes, and snippets.

@rsanheim
Created February 28, 2024 18:47
Show Gist options
  • Save rsanheim/32399bdbe72d29804cb2f0bbe9583a45 to your computer and use it in GitHub Desktop.
Save rsanheim/32399bdbe72d29804cb2f0bbe9583a45 to your computer and use it in GitHub Desktop.
debugging rails autoloading (classic mode)
# from https://makandracards.com/makandra/48754-how-to-debug-rails-autoloading
ActiveSupport::Dependencies.singleton_class.prepend(Module.new do
def load_missing_constant(*args)
Rails.logger.debug "#{__method__}(#{args.map(&:inspect).join(', ')})"
super
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment