I have a host app unicorn
with the model Article
.
I also have a mountable engine hooked into the host app called blorgh
. It also has a model: Article
. It is namespaced, so the table name for the engine's Article is actually blorgh_articles
.
While inside the engine I want to grab the host app's article
, not the engine's article
. Is this possible?
#blorgh/app/controllers/blorgh/articles_controller.rb
require_dependency "blorgh_application_controller"
module Blorgh
class ArticlesController < ApplicationController
def index
@articles = Article.all #properly grabs all the engine's articles
@host_app_articles = main_app.Article.all # this doesn't work. It should grab the host app's articles.
end
...
end
end