HTTPS clone URL
Subversion checkout URL
Please sign in to comment.
Fix cases where delete_records on a has_many association caused errors
because of an ambiguous column name. This happened if the association model had a default scope that referenced a third table, and the third table also referenced the original table (with an identical foreign_key). Mysql requires that ambiguous columns are deambiguated by using the full table.column syntax. Postgresql and Sqlite use a different syntax for updates altogether (and don't tolerate table.name syntax), so the fix requires always including the full table.column and discarding it later for Sqlite and Postgresql.
- Loading branch information...
Showing with 49 additions and 5 deletions.
- +12 −0 activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
- +4 −0 activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
- +4 −0 activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
- +4 −4 activerecord/lib/active_record/sanitization.rb
- +19 −1 activerecord/test/cases/associations/has_many_associations_test.rb
- +1 −0 activerecord/test/models/author.rb
- +5 −0 activerecord/test/models/post.rb