Access Models from OUTSIDE rails app

微笑、不失礼 提交于 2019-12-24 19:15:35

问题


I am writing a JRuby rails app that uses mysql-backed models. Now, I need to update the models from OUTSIDE the app (via EventMachine / similar), so that the Controllers etc IN the rails app can get access to the fresh data.

So, is the Rails ORM available inside EventMachine? Will there be catastrophic consequences if I update the mysql tables from inside EventMachine (if the ORM is not available to me)?


回答1:


You could always require 'config/environment.rb', that'll give you access to all the models.



来源:https://stackoverflow.com/questions/3056133/access-models-from-outside-rails-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!