mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
cb069ea7cc
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4019 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
23 lines
441 B
Ruby
23 lines
441 B
Ruby
class Module
|
|
def include_all_modules_from(parent_module)
|
|
parent_module.constants.each do |const|
|
|
mod = parent_module.const_get(const)
|
|
if mod.class == Module
|
|
send(:include, mod)
|
|
include_all_modules_from(mod)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
def helper
|
|
@helper_proxy ||= Object.new
|
|
end
|
|
|
|
require 'application'
|
|
|
|
class << helper
|
|
include_all_modules_from ActionView
|
|
end
|
|
|
|
@controller = ApplicationController.new
|