Rails 关于 application.rb 文件里的 config 对象???

qq2729877005 · July 19, 2018 · Last by qq2729877005 replied at July 21, 2018 · 1337 hits

在 application.rb 文件里的 cofing 对象是什么时候被实例化出来的???

我猜应该是这段代码……

module Rails
  class Application < Engine
    def config #:nodoc:
      @config ||= Application::Configuration.new(self.class.find_root(self.class.called_from))
    end
  end
end

调试了下,确认无疑,哥们是怎么找到的😅

继承链倒追回去找 config 对象……

大兄弟,你是用 RubyMine 的追还是用 byebug 追的?😅

qq2729877005 closed this topic. 19 Nov 17:16
You need to Sign in before reply, if you don't have an account, please Sign up first.