Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6781: console_helper_can_load_helper_files.diff

File console_helper_can_load_helper_files.diff, 0.6 kB (added by Chris Wanstrath, 2 years ago)

The patch

  • railties/lib/console_with_helpers.rb

    old new  
    1010  end 
    1111end 
    1212 
    13 def helper 
    14   @helper_proxy ||= Object.new  
     13def helper(*helper_names) 
     14  returning @helper_proxy ||= Object.new do |helper| 
     15    helper_names.each { |h| helper.extend "#{h}_helper".classify.constantize } 
     16  end 
    1517end 
    1618 
    1719require 'application' 
     
    2123end 
    2224 
    2325@controller = ApplicationController.new 
     26helper :application rescue nil