Created
August 23, 2011 03:22
-
-
Save kmdsbng/1164265 to your computer and use it in GitHub Desktop.
.pryrc に書いておく。rails consoleみたく、reload!を使えるようにする用。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # reloads the environment | |
| # to read rails env => $ pry -r pry -r ./config/environment.rb | |
| def reload!(print=true) | |
| puts "Reloading..." if print | |
| # This triggers the to_prepare callbacks | |
| ActionDispatch::Callbacks.new(Proc.new {}, false).call({}) | |
| true | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment