helzer a écrit, le 11/18/2009 07:43 PM :
> I'm doing a migration that needs to go through all rows in a DB table
> and update then.
>
> It takes forever and I've narrowed it down to Rails' own .save() call.
> If I do all the update without saving, it completes in a few seconds.
> With the Active Record save, 60000 rows take 15 minutes to update.
>
> Is there a way for me to bypass that and write the values directly to
> the database?
>
YourModel.connection.execute("your UPDATE in SQL here")
Lionel
--
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.