开发者

Anyone using ruby-protobuf and ActiveRecord

开发者 https://www.devze.com 2023-02-02 07:38 出处:网络
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. It

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号