Anyone using ruby-protobuf and ActiveRecord
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.
精彩评论