I have a Rails Engine and I want to access the parents models. Is that possible? If so, how would I do it?
Asked
Active
Viewed 1,762 times
10
-
What do you mean by "access"? The engine and Rails application run in the same thread of the same interpreter instance, so you can, for instance, access any class available through Ruby. Are you looking for an API to do so? – coreyward Jan 17 '12 at 02:40
-
Sorry... I have an engine and it's mounted in a Rails application. The Rails application has certain models (Let's say.. `User` as an example). I need the engine to read/write data from that model. – Shamoon Jan 17 '12 at 17:56
1 Answers
18
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.

jipiboily
- 1,240
- 10
- 17