aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-04-17 23:30:01 -0500
committerJoshua Peek <josh@joshpeek.com>2008-04-17 23:30:01 -0500
commitcf04e621270bb2e5e9e7971d2c59e73d6797482d (patch)
treeaf14a01cb712d6ade17f39da3a8103d7bf3bfd8c /actionpack
parent82b4faf81218bbd8916ab559590db236c7f80e46 (diff)
downloadrails-cf04e621270bb2e5e9e7971d2c59e73d6797482d.tar.gz
rails-cf04e621270bb2e5e9e7971d2c59e73d6797482d.tar.bz2
rails-cf04e621270bb2e5e9e7971d2c59e73d6797482d.zip
Tidy up ActiveSupport::Callbacks::CallbackChain instance API.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/dispatcher.rb2
-rw-r--r--actionpack/lib/action_controller/filters.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb
index 30db7d9f73..99e1f74c0a 100644
--- a/actionpack/lib/action_controller/dispatcher.rb
+++ b/actionpack/lib/action_controller/dispatcher.rb
@@ -22,7 +22,7 @@ module ActionController
def to_prepare(identifier = nil, &block)
@prepare_dispatch_callbacks ||= ActiveSupport::Callbacks::CallbackChain.new
callback = ActiveSupport::Callbacks::Callback.new(:prepare_dispatch, block, :identifier => identifier)
- @prepare_dispatch_callbacks.replace_or_append_callback(callback)
+ @prepare_dispatch_callbacks | callback
end
# If the block raises, send status code as a last-ditch response.
diff --git a/actionpack/lib/action_controller/filters.rb b/actionpack/lib/action_controller/filters.rb
index 73721cd1ec..8c97787741 100644
--- a/actionpack/lib/action_controller/filters.rb
+++ b/actionpack/lib/action_controller/filters.rb
@@ -265,7 +265,7 @@ module ActionController #:nodoc:
def skip_filter_in_chain(*filters, &test)
filters, conditions = extract_options(filters)
filters.each do |filter|
- if callback = find_callback(filter) then delete(callback) end
+ if callback = find(filter) then delete(callback) end
end if conditions.empty?
update_filter_in_chain(filters, :skip => conditions, &test)
end
@@ -302,7 +302,7 @@ module ActionController #:nodoc:
def find_or_create_filter(filter, filter_type, options = {})
update_filter_in_chain([filter], options)
- if found_filter = find_callback(filter) { |f| f.type == filter_type }
+ if found_filter = find(filter) { |f| f.type == filter_type }
found_filter
else
filter_kind = case
@@ -326,7 +326,7 @@ module ActionController #:nodoc:
end
def update_filter_in_chain(filters, options, &test)
- filters.map! { |f| block_given? ? find_callback(f, &test) : find_callback(f) }
+ filters.map! { |f| block_given? ? find(f, &test) : find(f) }
filters.compact!
map! do |filter|