Creating a belongs_to relationship with a model from the main app from an engine model
问题 I've built myself a Rails Engine that requires that the main app have a Users table. I need to be able to create a relationship between one of the models in my engine and the Users table in the main app. Is this more complicated than just saying belongs_to :user ? I'm getting an error that says the User object is nil, but when I use the console it returns the right user. My assumption is that Rails assumed my belongs_to :user call meant a User's class in the same namespace as the engine, i.e.