I am importing historical client data from a CODASYL DBMS into
PostgreSQL via an xml document.  I am at the point where I am
implementing the actual inserts/updates using ActiveRecord.  In the
new system a Client belongs to a Correspondent.

In previous cases I have had to deal with only one model at a time.
In that circumstance I added a class method called 'load' to the model
class and passed it an array of hashes each containing the model
attribute keys and values.  In this case I have to divide the
information in one xml node into two models.

My question is one of approach.  Do I create each associated
Correspondent model inside the Client class load method and parse all
the data there?  Or, do I have the controller script parse the data
first, divide the data into two streams, and then call two separate
#loads, one on the Correspondent model and one on the Client model?

Thoughts?

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to