aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rwxr-xr-xactionpack/lib/action_controller.rb2
-rw-r--r--actionpack/lib/action_controller/deprecated_dependencies.rb65
3 files changed, 1 insertions, 68 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 37783e3752..49b02a1920 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,6 +1,6 @@
*SVN*
-* Deprecation: remove deprecated instance variables, request methods, and redirect methods. [Jeremy Kemper]
+* Deprecation: remove deprecated request, redirect, and dependency methods. Remove deprecated instance variables. [Jeremy Kemper]
* Consistent public/protected/private visibility for chained methods. #7813 [Dan Manges]
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb
index cc5ba2b2b2..cabcae866b 100755
--- a/actionpack/lib/action_controller.rb
+++ b/actionpack/lib/action_controller.rb
@@ -43,7 +43,6 @@ require 'action_controller/benchmarking'
require 'action_controller/flash'
require 'action_controller/filters'
require 'action_controller/layout'
-require 'action_controller/deprecated_dependencies'
require 'action_controller/mime_responds'
require 'action_controller/pagination'
require 'action_controller/scaffolding'
@@ -67,7 +66,6 @@ ActionController::Base.class_eval do
include ActionController::Layout
include ActionController::Benchmarking
include ActionController::Rescue
- include ActionController::Dependencies
include ActionController::MimeResponds
include ActionController::Pagination
include ActionController::Scaffolding
diff --git a/actionpack/lib/action_controller/deprecated_dependencies.rb b/actionpack/lib/action_controller/deprecated_dependencies.rb
deleted file mode 100644
index 433b9e5af8..0000000000
--- a/actionpack/lib/action_controller/deprecated_dependencies.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-module ActionController #:nodoc:
- module Dependencies #:nodoc:
- def self.included(base)
- base.extend(ClassMethods)
- end
-
- # Deprecated module. The responsibility of loading dependencies belong with Active Support now.
- module ClassMethods #:nodoc:
- # Specifies a variable number of models that this controller depends on. Models are normally Active Record classes or a similar
- # backend for modelling entity classes.
- def model(*models)
- require_dependencies(:model, models)
- depend_on(:model, models)
- end
- deprecate :model
-
- # Specifies a variable number of services that this controller depends on. Services are normally singletons or factories, like
- # Action Mailer service or a Payment Gateway service.
- def service(*services)
- require_dependencies(:service, services)
- depend_on(:service, services)
- end
- deprecate :service
-
- # Specifies a variable number of observers that are to govern when this controller is handling actions. The observers will
- # automatically have .instance called on them to make them active on assignment.
- def observer(*observers)
- require_dependencies(:observer, observers)
- depend_on(:observer, observers)
- instantiate_observers(observers)
- end
- deprecate :observer
-
- # Returns an array of symbols that specify the dependencies on a given layer. For the example at the top, calling
- # <tt>ApplicationController.dependencies_on(:model)</tt> would return <tt>[:account, :company, :person, :project, :category]</tt>
- def dependencies_on(layer)
- read_inheritable_attribute("#{layer}_dependencies")
- end
- deprecate :dependencies_on
-
- def depend_on(layer, dependencies) #:nodoc:
- write_inheritable_array("#{layer}_dependencies", dependencies)
- end
- deprecate :depend_on
-
- private
- def instantiate_observers(observers)
- observers.flatten.each { |observer| Object.const_get(Inflector.classify(observer.to_s)).instance }
- end
-
- def require_dependencies(layer, dependencies)
- dependencies.flatten.each do |dependency|
- begin
- require_dependency(dependency.to_s)
- rescue LoadError => e
- raise LoadError.new("Missing #{layer} #{dependency}.rb").copy_blame!(e)
- rescue Exception => exception # error from loaded file
- exception.blame_file! "=> #{layer} #{dependency}.rb"
- raise
- end
- end
- end
- end
- end
-end