diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-05-07 10:38:57 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-05-07 10:38:57 -0500 |
commit | af40fa6d036d86895e7be4ef46a615d44eb41ede (patch) | |
tree | 481cd4d0aaf724833ce4c97fcaaf56aa8e109891 /actionpack/lib/action_controller | |
parent | 2854535b02bcee3668bda02c76c3105fc24730d3 (diff) | |
download | rails-af40fa6d036d86895e7be4ef46a615d44eb41ede.tar.gz rails-af40fa6d036d86895e7be4ef46a615d44eb41ede.tar.bz2 rails-af40fa6d036d86895e7be4ef46a615d44eb41ede.zip |
Prefer "included" language over "setup"
Diffstat (limited to 'actionpack/lib/action_controller')
5 files changed, 18 insertions, 15 deletions
diff --git a/actionpack/lib/action_controller/abstract/callbacks.rb b/actionpack/lib/action_controller/abstract/callbacks.rb index c8b509081c..d7faaf4236 100644 --- a/actionpack/lib/action_controller/abstract/callbacks.rb +++ b/actionpack/lib/action_controller/abstract/callbacks.rb @@ -1,10 +1,13 @@ module AbstractController module Callbacks - setup do - include ActiveSupport::NewCallbacks - define_callbacks :process_action + extend ActiveSupport::DependencyModule + + depends_on ActiveSupport::NewCallbacks + + included do + define_callbacks :process_action end - + def process_action _run_process_action_callbacks(action_name) do super diff --git a/actionpack/lib/action_controller/abstract/helpers.rb b/actionpack/lib/action_controller/abstract/helpers.rb index ffcae29ddc..62caa119e7 100644 --- a/actionpack/lib/action_controller/abstract/helpers.rb +++ b/actionpack/lib/action_controller/abstract/helpers.rb @@ -3,8 +3,8 @@ module AbstractController extend ActiveSupport::DependencyModule depends_on Renderer - - setup do + + included do extlib_inheritable_accessor :master_helper_module self.master_helper_module = Module.new end diff --git a/actionpack/lib/action_controller/abstract/logger.rb b/actionpack/lib/action_controller/abstract/logger.rb index bdb8defa0c..5fb78f1755 100644 --- a/actionpack/lib/action_controller/abstract/logger.rb +++ b/actionpack/lib/action_controller/abstract/logger.rb @@ -2,7 +2,7 @@ module AbstractController module Logger extend ActiveSupport::DependencyModule - setup do + included do cattr_accessor :logger end end diff --git a/actionpack/lib/action_controller/abstract/renderer.rb b/actionpack/lib/action_controller/abstract/renderer.rb index 531eb28dcb..beb848f90e 100644 --- a/actionpack/lib/action_controller/abstract/renderer.rb +++ b/actionpack/lib/action_controller/abstract/renderer.rb @@ -5,15 +5,15 @@ module AbstractController extend ActiveSupport::DependencyModule depends_on AbstractController::Logger - - setup do + + included do attr_internal :formats - + extlib_inheritable_accessor :_view_paths - + self._view_paths ||= ActionView::PathSet.new end - + def _action_view @_action_view ||= ActionView::Base.new(self.class.view_paths, {}, self) end diff --git a/actionpack/lib/action_controller/new_base/hide_actions.rb b/actionpack/lib/action_controller/new_base/hide_actions.rb index 473a8ea72b..aa420442fb 100644 --- a/actionpack/lib/action_controller/new_base/hide_actions.rb +++ b/actionpack/lib/action_controller/new_base/hide_actions.rb @@ -1,10 +1,10 @@ module ActionController module HideActions - setup do + included do extlib_inheritable_accessor :hidden_actions - self.hidden_actions ||= Set.new + self.hidden_actions ||= Set.new end - + def action_methods() self.class.action_names end def action_names() action_methods end |