Can a Rails 3 engine access models from it's parent application?

前端 未结 1 507
粉色の甜心
粉色の甜心 2021-02-06 00:35

I have a Rails Engine and I want to access the parents models. Is that possible? If so, how would I do it?

1条回答
  •  礼貌的吻别
    2021-02-06 01:20

    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.

    0 讨论(0)
提交回复
热议问题