Generate SQL-Statement from Model.save()

Hello!

Im a rails newbie, i like rails very much, but now I have a problem:

I want to generate in one action about 3000 sql statements (mailtemplate that becomes generateted to a mail (with personal salutation,...)).

I tried it with:

x=0 while x < 300 q = mail.new(params...) q.save() end

but thats muuuuch toooo slow.... Is there a chance to get the generated sql statement back and execute it afterwards with only one sql-execution statement?

thanks!

While it's not exactly the same as you are looking to do, there was a discussion of something similar in this thread

If you have the patience to get to the end (and it's really not that long), there is an example of extending ActiveRecord to support return the generated SQL. It probably wouldn't be too hard to do what you are looking to do.

Peace, Phillip