I have two instances of a intranet Rails application running on different networks. The database design for each is the same, but the data is different. I occasionally need for certain database records to be copied from application to another. I would like to serialize the records and send the data to the 2nd application's web server , where a controller action would unserialize the records, process them and store in the 2nd database. I am not sure how to do this. Any ideas? Regards, Don Mc
on 2007-05-08 21:11
on 2007-05-08 23:22
It sounds like what you might be asking for is marshaling. I haven't tried it, but here's a reference: http://www.ruby-doc.org/docs/ProgrammingRuby/html/... --Paul
on 2007-05-09 09:30
Or you could follow the hot trend in rails and just have them talk to each other via REST. There's support in the current version of rails for scaffolding (generating) your models as "resources", which means you get basic controller actions that return xml of your object if called as a REST call. ActiveRecord will also do basic serialization to xml out of the box. If your needs are fairly straightforward, this can be a very quick thing to code. Oh, and there's also ActiveResource, a REST client library that allows you to use the models from one app in another by making the REST calls for you behind the scenes. And finally, since it's been a hot topic, there's lots of information out there about RESTful rails... b
on 2007-05-09 16:15
Paul and Ben, Thanks for the help!