aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/console_with_helpers.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-11-23 15:15:05 -0600
committerJoshua Peek <josh@joshpeek.com>2008-11-23 15:15:20 -0600
commitd75a2345015046e08f8191748f0e246e1b9f9703 (patch)
tree947c07417722a95dec62f3ca88f77ed08c26b579 /railties/lib/console_with_helpers.rb
parentd36158794b19ee8ea49d74061218b37d4301f0f9 (diff)
downloadrails-d75a2345015046e08f8191748f0e246e1b9f9703.tar.gz
rails-d75a2345015046e08f8191748f0e246e1b9f9703.tar.bz2
rails-d75a2345015046e08f8191748f0e246e1b9f9703.zip
simplify console with helpers
Diffstat (limited to 'railties/lib/console_with_helpers.rb')
-rw-r--r--railties/lib/console_with_helpers.rb23
1 files changed, 2 insertions, 21 deletions
diff --git a/railties/lib/console_with_helpers.rb b/railties/lib/console_with_helpers.rb
index f9e8bf9cbf..039db667c4 100644
--- a/railties/lib/console_with_helpers.rb
+++ b/railties/lib/console_with_helpers.rb
@@ -1,24 +1,5 @@
-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_names)
- returning @helper_proxy ||= Object.new do |helper|
- helper_names.each { |h| helper.extend "#{h}_helper".classify.constantize }
- end
-end
-
-class << helper
- include_all_modules_from ActionView
+def helper
+ @helper ||= ApplicationController.helpers
end
@controller = ApplicationController.new
-helper :application rescue nil