Thanks. I have created a task for doing this but I was just looking for a way to iterate over all the models programmatically. Your method requires that the task be updated every time a new model is added to the app.
On Thu, Mar 4, 2010 at 4:32 PM, MarkMT <[email protected]> wrote: > I had a similar need in a merb app but did it in my application rather > than using rake. My approach is here - http://gist.github.com/321796 . > > As I look at this now, there are a few things there that look slightly > puzzling to me just at this moment, but it has served my simple needs > ok and may be a useful starting point for what you require. > > Mark. > > > > On Mar 4, 5:56 am, Carl Youngblood <[email protected]> wrote: >> I'm developing a sinatra app. I have it configured to use sqlite3 when >> developing on my local machine and mysql in production. I would like >> to write a rake task to copy the data from my production db into my >> local sqlite3 db. I assume this is easy in datamapper, but I'm not >> sure how to do it. I was thinking of setting up two data repositories >> and using the copy method to copy each table's data from one store to >> the other. It would be nice if I had a way of iterating over all the >> models in a database. Is there a way to do this in dm? >> >> Thanks, >> Carl > > -- > You received this message because you are subscribed to the Google Groups > "DataMapper" 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/datamapper?hl=en. > > -- You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en.
