クラスやモジュールが定義されるタイミングを知りたくてコードを追っていたところ、Rails2.3.2のCHANGELOGに以下のような記述があることに気がつきました。
RAILS_ROOT/config/environment.rbで以下のように設定すると、* Add debugging logging to Dependencies. Currently can be enabled with Dependencies.log_activity = true; adding to Initializer and documenting is forthcoming. [Nicholas Seckar]
1 2 |
ActiveSupport::Dependencies.logger = Logger.new(STDOUT) ActiveSupport::Dependencies.log_activity = true |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Processing HogesController#index (for ::ffff:192.168.181.1 at 2009-07-25 20:24:45) [GET]
Hoge Load (1.5ms) SELECT * FROM "hoges"
Rendering template within layouts/hoges
Rendering hoges/index
Completed in 22ms (View: 11, DB: 2) | 200 OK [http://192.168.181.3/hoges]
Dependencies: called new_constants_in(Object)
Dependencies: New constants:
Dependencies: called new_constants_in(Object)
Dependencies: New constants:
Dependencies: called load_missing_constant(Object, "HogesController")
Dependencies: called require_or_load("/home/masayuki/work/rails/generator/test1/app/controllers/hoges_controller.rb", nil)
...(省略)...
Dependencies: called clear()
Dependencies: removing constant ApplicationHelper
Dependencies: removing constant HogesHelper
Dependencies: removing constant ApplicationController
Dependencies: removing constant HogesController
Dependencies: removing constant Hoge
Processing HogesController#new (for ::ffff:192.168.181.1 at 2009-07-25 20:24:47) [GET]
Rendering template within layouts/hoges
Rendering hoges/new
Completed in 20ms (View: 8, DB: 0) | 200 OK [http://192.168.181.3/hoges/new] |
Sorry, comments are closed for this article.