Permalink
Browse files

defines a private require-hub active_support/rails

This is a private place to put those AS features that are used
by every component. Nowadays we cherry-pick individual files
wherever they are used, but that it is not worth the effort
for stuff that is going to be loaded for sure sooner or later,
like blank?, autoload, concern, etc.
  • Loading branch information...
1 parent 7a7ec74 commit 1a7b2e8fadc34a70ad891b3b111a06e384fd3c6d @fxn fxn committed Aug 2, 2012
@@ -26,6 +26,7 @@
require 'action_mailer/version'
# Common Active Support usage in Action Mailer
+require 'active_support/rails'
require 'active_support/core_ext/class'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/module/attr_internal'
@@ -1,4 +1,5 @@
require 'action_pack'
+require 'active_support/rails'
require 'active_support/concern'
require 'active_support/dependencies/autoload'
require 'active_support/core_ext/class/attribute'
@@ -1,3 +1,4 @@
+require 'active_support/rails'
require 'abstract_controller'
require 'action_dispatch'
require 'action_controller/metal/live'
@@ -22,6 +22,7 @@
#++
require 'active_support'
+require 'active_support/rails'
require 'active_support/dependencies/autoload'
require 'active_support/core_ext/module/attribute_accessors'
@@ -22,6 +22,7 @@
#++
require 'active_support'
+require 'active_support/rails'
require 'action_pack'
module ActionView
@@ -22,6 +22,7 @@
#++
require 'active_support'
+require 'active_support/rails'
require 'active_model/version'
module ActiveModel
@@ -22,6 +22,7 @@
#++
require 'active_support'
+require 'active_support/rails'
require 'active_model'
require 'arel'
require 'active_record_deprecated_finders'
@@ -0,0 +1,9 @@
+# This is private interface.
+#
+# Rails components cherry pick from Active Support as needed, but there are a
+# few features that are used for sure some way or another and it is not worth
+# to put individual requires absolutely everywhere. Think blank? for example.
+#
+# This file is loaded by every Rails component except Active Support itself,
+# but it does not belong to the Rails public interface. It is internal to
+# Rails and can change anytime.

4 comments on commit 1a7b2e8

Contributor

paneq replied Aug 2, 2012

Why do you think blank? is internal interface to rails ? Lot of people out there use active support extensions and relay on their existence.

Owner

fxn replied Aug 2, 2012

@paneq I am referring to the file itself, that external code cannot load active_support/rails.rb and expect it to load anything in particular. Well, that external code should not load this file at all in practice.

Contributor

paneq replied Aug 3, 2012

Thank you for the explanation.

Owner

pixeltrix replied Aug 4, 2012

@fxn any guidelines on what this should contain? For example Array#extract_options! and Hash#reverse_merge! are used widely throughout the Rails source code so I would've thought those should be in here - I couldn't find any discussion in Campfire.

Please sign in to comment.