Synchronizing a table to a spreadsheet

Patrick Doyle
2008-04-10T15:50:30Z

Hello all,
As much as I hate saying this, I would like to maintain 2 copies of
some data, one copy in the form of a table in a database, and one in
the form of an Excel spreadsheet.  Unfortunately, either or both
copies may be modified, so I need some way to synchronize the two,
much the same way as a contacts database might be synchronized between
a PDA and a desktop application.

I am curious to learn from you... how would you do this?

I could put the "synchronize the data" logic in the ActiveRecord model
and add some controller and view code that would enable me to upload
the current spreadsheet, compute the differences between the two,
display those differences along with some mechanism to accept or
reject the changes, and download the new version of the modified
spreadsheet.

Does that "synchronize the data" logic belong in the model?  In the
controller?  In a helper module?  I expect that it will be very
specific to the model, and to the schema of that database.

Or I could create a rake task to do this

Or I could create a standalone ruby script to do this.

Or I could do something else which I haven''t even thought of yet.

I like the idea of presenting the differences via the GUI of a web
browser (even though I am daunted by the amount of work that would
entail for somebody with no web development experience).

Also, tangenting slightly, I am curious how this sort of "go off and
do some work" type of behavior would map in the the RESTful way of
doing things.  I suppose that I could view the list of differences as
a resource which can be indexed and edited, but I wonder if that is
trying to fit a square peg in a round hole.

Finally, perhaps somebody has already done just this and would care to
share his/her experience in how (s)he approached this problem.

I feel reasonably confident (some would say overconfident) in my
ability to extract the data from the Excel workbook and compare it
with the data in my database.  I''m just not sure where would be a
reasonable place to put that sort of logic.

--wpd

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---