Permalink
Browse files

Merge [5715] from trunk. Closes #6699.

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5716 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 590b192 commit 6df67f5607697a89967b22a29d564e6f6f6b03b8 @jeremy jeremy committed Dec 12, 2006
Showing with 5 additions and 5 deletions.
  1. +2 −0 actionpack/CHANGELOG
  2. +3 −5 actionpack/lib/action_controller/filters.rb
@@ -1,5 +1,7 @@
*1.13.0 RC2*
+* Correctly report which filter halted the chain. #6699 [Martin Emde]
+
* respond_to recognizes JSON. render :json => @person.to_json automatically sets the content type and takes a :callback option to specify a client-side function to call using the rendered JSON as an argument. #4185 [Scott Raymond, eventualbuddha]
# application/json response with body 'Element.show({:name: "David"})'
respond_to do |format|
@@ -616,10 +616,7 @@ def self.included(base)
end
def perform_action_with_filters
- #result = perform_filters do
- # perform_action_without_filters unless performed?
- #end
- @before_filter_chain_aborted = (call_filter(self.class.filter_chain, 0) == false)
+ call_filter(self.class.filter_chain, 0)
end
def process_with_filters(request, response, method = :perform_action, *arguments) #:nodoc:
@@ -640,7 +637,7 @@ def call_filter(chain, index)
filter.call(self) do
halted = call_filter(chain, index.next)
end
- halt_filter_chain(filter.filter, :no_yield) if halted == false
+ halt_filter_chain(filter.filter, :no_yield) if halted == false unless @before_filter_chain_aborted
halted
end
@@ -653,6 +650,7 @@ def halt_filter_chain(filter, reason)
logger.info "Filter chain halted as [#{filter.inspect}] returned false."
end
end
+ @before_filter_chain_aborted = true
return false
end

0 comments on commit 6df67f5

Please sign in to comment.