On 1/3/08, brendan <[EMAIL PROTECTED]> wrote:
> http://dev.rubyonrails.org/ticket/10686
>
> I'd really appreciate it if a few people would test patch this out and
> give feedback.
>
> It changes the SQL generated by update_all so that passing :limit
> or :order options will work with non-MySQL adapters.  The SQL
> currently generated creates SQL Exceptions for non-MySQL adapters.
>
> Added tests pass for MySQL, PostgreSQL, and Sqlite3; I'm working on
> tests to run (period) for other adapters, so testing those would be
> most helpful.
>
> Verification, comments, and +1s would be appreciated!

The :limit and :order options are meant to apply to the UPDATE
statement directly -- simply don't use them with databases that don't
support it.

The issue you're seeing is that :limit and :order are being pulled
from the association scope -- this is a bug, IMO, and should be fixed
rather than adding roundabout support for a niche feature.

See http://dev.mysql.com/doc/refman/5.1/en/update.html for why you
sometimes want to use UPDATE ... ORDER BY with MySQL. It works around
duplicate key errors.

Best,
jeremy

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to