在 2 个 Rails API 之间共享模型(单独的应用程序) [英] Share Models between 2 Rails API's (Separate Applications)

查看:27
本文介绍了在 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?

谢谢!

推荐答案

你可以看看:

这篇关于在 2 个 Rails API 之间共享模型(单独的应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆