Changeset 4948
- Timestamp:
- 09/03/06 23:08:43 (2 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/deprecated_dependencies.rb (moved) (moved from trunk/actionpack/lib/action_controller/dependencies.rb) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r4929 r4948 1 1 *SVN* 2 3 * Deprecated all of ActionController::Dependencies. All dependency loading is now handled from Active Support [DHH] 2 4 3 5 * Added assert_select* for CSS selector-based testing (deprecates assert_tag) #5936 [assaf.arkin@gmail.com] trunk/actionpack/lib/action_controller.rb
r4922 r4948 44 44 require 'action_controller/filters' 45 45 require 'action_controller/layout' 46 require 'action_controller/dep endencies'46 require 'action_controller/deprecated_dependencies' 47 47 require 'action_controller/mime_responds' 48 48 require 'action_controller/pagination' trunk/actionpack/lib/action_controller/deprecated_dependencies.rb
r4885 r4948 5 5 end 6 6 7 # Dependencies control what classes are needed for the controller to run its course. This is an alternative to doing explicit 8 # +require+ statements that bring a number of benefits. It's more succinct, communicates what type of dependency we're talking about, 9 # can trigger special behavior (as in the case of +observer+), and enables Rails to be clever about reloading in cached environments 10 # like FCGI. Example: 11 # 12 # class ApplicationController < ActionController::Base 13 # model :account, :company, :person, :project, :category 14 # helper :access_control 15 # service :notifications, :billings 16 # observer :project_change_observer 17 # end 18 # 19 # Please note that a controller like ApplicationController will automatically attempt to require_dependency on a model of its 20 # singuralized name and a helper of its name. If nothing is found, no error is raised. This is especially useful for concrete 21 # controllers like PostController: 22 # 23 # class PostController < ApplicationController 24 # # model :post (already required) 25 # # helper :post (already required) 26 # end 27 # 28 # Also note, that if the models follow the pattern of just 1 class per file in the form of MyClass => my_class.rb, then these 29 # classes don't have to be required as Active Support will auto-require them. 7 # Deprecated module. The responsibility of loading dependencies belong with Active Support now. 30 8 module ClassMethods #:nodoc: 31 9 # Specifies a variable number of models that this controller depends on. Models are normally Active Record classes or a similar … … 35 13 depend_on(:model, models) 36 14 end 15 deprecate :model 37 16 38 17 # Specifies a variable number of services that this controller depends on. Services are normally singletons or factories, like … … 42 21 depend_on(:service, services) 43 22 end 23 deprecate :service 44 24 45 25 # Specifies a variable number of observers that are to govern when this controller is handling actions. The observers will … … 50 30 instantiate_observers(observers) 51 31 end 32 deprecate :observer 52 33 53 34 # Returns an array of symbols that specify the dependencies on a given layer. For the example at the top, calling … … 56 37 read_inheritable_attribute("#{layer}_dependencies") 57 38 end 58 39 deprecate :dependencies_on 40 59 41 def depend_on(layer, dependencies) #:nodoc: 60 42 write_inheritable_array("#{layer}_dependencies", dependencies) 61 43 end 44 deprecate :depend_on 62 45 63 46 private