新手问题 块中只写类名和模块名有什么作用?

Dounx · July 09, 2019 · Last by Dounx replied at July 10, 2019 · 1730 hits
# app/models/a.rb
class A
end

# app/models/b.rb
module B
end

# config/application.rb
config.to_prepare do
  A
  B
end

请问在 config.to_prepare 块中只写 A B 有什么作用?

触发 const_missing

Reply to mizuhashi

感谢,在 A B 中找到了这个方法

Dounx closed this topic. 10 Jul 11:38
You need to Sign in before reply, if you don't have an account, please Sign up first.