Permalink
Browse files

explains why these requires are in an unusual place

  • Loading branch information...
1 parent e0deb0e commit 918f7038b3d4d4180a4d1056bb4b7b3f3b85508f @fxn fxn committed Oct 7, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 activesupport/lib/active_support/deprecation.rb
@@ -4,6 +4,14 @@ module ActiveSupport
# \Deprecation specifies the API used by Rails to deprecate methods, instance
# variables, objects and constants.
class Deprecation
+ # active_support.rb sets an autoload for ActiveSupport::Deprecation.
+ #
+ # If these requires were at the top of the file the constant would not be
+ # defined by the time their files were loaded. Since some of them reopen
+ # ActiveSupport::Deprecation its autoload would be triggered, resulting in
+ # a circular require warning for active_support/deprecation.rb.
+ #
+ # So, we define the constant first, and load dependencies later.
require 'active_support/deprecation/instance_delegator'
require 'active_support/deprecation/behaviors'
require 'active_support/deprecation/reporting'

0 comments on commit 918f703

Please sign in to comment.