任何使用 ruby​​-protobuf 和 A​​ctiveRecord 的人

发布于 2024-10-09 17:47:16 字数 251 浏览 0 评论 0原文

我正在使用 google 协议缓冲区、ruby-protobuf、rails 和 ActiveRecord。该协议本身似乎是一个不错的选择,特别是因为我们要连接到移动设备。它是一种非常紧凑的格式。

当必须从原始对象转换为 ActiveRecord 对象时就会出现问题,反之亦然。看来这里有很多额外的工作。我希望它的工作方式类似于 ruby​​-amf 的工作方式。

有人以前见过这样做吗?

...或者认为有兴趣开始开发 Rails 插件?

I am using googles protocol buffers, ruby-protobuf, with rails and ActiveRecord. The protocol itself seems like a good choice, especially since we are connecting to mobile devices. Its a very compact format.

The issues arise when having to go from proto objects to ActiveRecord objects and vice versa. Seems like there is a lot of extra work here. I would like it to work similar to the way ruby-amf works.

Anyone see this done before?

...or think there would be interest in starting work on a plugin for rails?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不…忘初心 2024-10-16 17:47:16

我们在项目中做了类似的事情。我们编写了一些代码将 proto_buf 转换为 Rails params 哈希。从那里我们可以通过参数访问任何值,并且模型可以接受参数。代码并不是很漂亮,但是可以完成工作。

We did a similar thing in our project. We wrote some code to convert proto_buf to rails params hash. From there we can then access any value through params and the model can take in params. The code is not really pretty but does the job.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文