问题
I have a Rails Engine and I want to access the parents models. Is that possible? If so, how would I do it?
回答1:
I didn't find any official documentation about it, but here's how you could still do it:
tests = ::Test.all
It'll return all tests from the parent app Test model.
来源:https://stackoverflow.com/questions/8855965/can-a-rails-3-engine-access-models-from-its-parent-application