提交 29ea0f68 编写于 作者: J Joshua Peek

Merge branch 'master' of git@github.com:josh/rails

...@@ -97,15 +97,14 @@ def run(object, options = {}, &terminator) ...@@ -97,15 +97,14 @@ def run(object, options = {}, &terminator)
end end
def |(chain) def |(chain)
if chain.is_a?(Callback) if chain.is_a?(CallbackChain)
if found_callback = find(chain) chain.each { |callback| self | callback }
index = index(found_callback) elsif chain.is_a?(Callback)
if index = index(chain)
self[index] = chain self[index] = chain
else else
self << chain self << chain
end end
else
chain.each { |callback| self | callback }
end end
self self
end end
...@@ -115,7 +114,7 @@ def find(callback, &block) ...@@ -115,7 +114,7 @@ def find(callback, &block)
end end
def delete(callback) def delete(callback)
super(find(callback)) super(callback.is_a?(Callback) ? callback : find(callback))
end end
private private
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册