I have two repositories set up within data mapper as follows:
DataMapper.setup(:default, "sqlite://path/to/db1")
DataMapper.setup(:another, "sqlite://path/to/otherdb")
Lets say I have a model Foo
that they both share a schema for. This is the pseudocode that I want to accomplish:
DataMapper.repository(:default){
Foo.each do |f|
# do some transformations
# write to Foo table in DataMapper.repository(:another)
end
}
How would I go about this?