I’m trying to learn Rails by looking at large real-world open source Rails apps.
The Ruby file
discourse.rb has a line of code near the top which is executed very early in the Discourse application life cycle:
Yet, I can’t see where the function
require_dependency would be made globally available?
I’d tried something similar in a very simple Rails app and encounter the error:
undefined method `require_dependency' for main:Object
I can make it work by adding:
require_dependency line, but I prefer your technique.
So, there must be something I’m missing in the magic of Discourse?
(I also posted a more general question on StackOverflow, but it hasn’t gotten a response or much traffic).