Skip to content
This repository
Browse code

explains why these requires are in an unusual place

  • Loading branch information...
commit 918f7038b3d4d4180a4d1056bb4b7b3f3b85508f 1 parent e0deb0e
Xavier Noria fxn authored

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. +8 0 activesupport/lib/active_support/deprecation.rb
8 activesupport/lib/active_support/deprecation.rb
@@ -4,6 +4,14 @@ module ActiveSupport
4 4 # \Deprecation specifies the API used by Rails to deprecate methods, instance
5 5 # variables, objects and constants.
6 6 class Deprecation
  7 + # active_support.rb sets an autoload for ActiveSupport::Deprecation.
  8 + #
  9 + # If these requires were at the top of the file the constant would not be
  10 + # defined by the time their files were loaded. Since some of them reopen
  11 + # ActiveSupport::Deprecation its autoload would be triggered, resulting in
  12 + # a circular require warning for active_support/deprecation.rb.
  13 + #
  14 + # So, we define the constant first, and load dependencies later.
7 15 require 'active_support/deprecation/instance_delegator'
8 16 require 'active_support/deprecation/behaviors'
9 17 require 'active_support/deprecation/reporting'

0 comments on commit 918f703

Please sign in to comment.
Something went wrong with that request. Please try again.