提交 cd97d0b5 编写于 作者: A Aaron Patterson

we know the classes will be a list, so *tell* it to respond to each

rather than casting
上级 fb3e09a8
......@@ -124,7 +124,7 @@ def length
end
def install(destinations = [ActionController::Base, ActionView::Base])
Array(destinations).each do |dest|
destinations.each do |dest|
dest.__send__(:include, @module)
end
end
......@@ -278,7 +278,7 @@ def clear!
end
def install_helpers(destinations = [ActionController::Base, ActionView::Base])
Array(destinations).each { |d| d.module_eval { include Helpers } }
destinations.each { |d| d.module_eval { include Helpers } }
named_routes.install(destinations)
end
......@@ -324,7 +324,7 @@ def self.url_for(options)
# we can include?
# Yes plz - JP
included do
routes.install_helpers(self)
routes.install_helpers([self])
singleton_class.send(:redefine_method, :_routes) { routes }
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册