在 2 个 Rails API 之间共享模型(单独的应用程序) [英] Share Models between 2 Rails API's (Separate Applications)
本文介绍了在 2 个 Rails API 之间共享模型(单独的应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前正在使用 Ruby on Rails 构建 2 个 API.一个用于读取(查找对象,查询),另一个用于实际写入,涉及一种带有队列和另一个 API 的复杂过程.两个应用程序都需要完全相同的模型和内部逻辑.
I'm currently building 2 API's using Ruby on Rails. One if for reading (finding objects, querying) and the other one is for actually writing to it, involving a kind of complicated process with queues and another API. Both applications require the exact same models and logic inside them.
我的问题是,在 2 个 Rails 应用程序之间共享模型规范(关系、范围、方法)的最常见最佳实践或方法是什么?
My question is, what's the most common best practice or approach to share models specifications (relationships, scopes, methods) between 2 rails applications?
谢谢!
推荐答案
你可以看看:
- 分享 ActiveRecord 的最佳方式不同 Rails 应用之间的模型和数据?
- 两个 Rails 应用共享一个模型文件夹
- 之间的共享模型两个 Rails 应用程序 - Workflow 的理想解决方案是什么?
这篇关于在 2 个 Rails API 之间共享模型(单独的应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文