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

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

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