validates_uniqueness_of does not quote scoped column names and then barfs

this is a silly bug that breaks any code where the column name of a scope is a reserved word (like group):

cfp:/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8 > diff -buB lib/active_record/validations.rb.org lib/active_record/validations.rb

--- lib/active_record/validations.rb.org 2010-06-19 09:38:42.000000000 -0600 +++ lib/active_record/validations.rb 2010-06-19 09:39:01.000000000 -0600 @@ -825,7 +825,7 @@            if scope = configuration[:scope]              Array(scope).map do |scope_item|                scope_value = record.send(scope_item) - condition_sql << " AND " << attribute_condition("#{record.class.quoted_table_name}.#{scope_item}", scope_value) + condition_sql << " AND " << attribute_condition("#{record.class.quoted_table_name}.#{connection.quote_column_name(scope_item)}", scope_value)                condition_params << scope_value              end            end

Could you open an issue on LH and attach a patch following the guidelines? So core team can make the patch yours. Thank you ;).

https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4909-validates_uniqueness_of-does-not-quote-scoped-column-names-and-then-barfs

I replied your ticket asking to follow https://rails.lighthouseapp.com/projects/8994/sending-patches and to do a test case for this issue. Thank you ara.t.howard.