aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorDavid Dollar <ddollar@gmail.com>2008-04-13 03:36:37 -0400
committerMichael Koziarski <michael@koziarski.com>2008-04-23 21:02:00 +1200
commit6c1c16bfd9eb865dffa68c12c7df66d5a59a8714 (patch)
treedf4bc7789c4d1fe83085b725be0d1fe4a6223880 /activerecord/lib/active_record
parent30ad1827a66b8578cabc8f14a67c69b0ab17cf92 (diff)
downloadrails-6c1c16bfd9eb865dffa68c12c7df66d5a59a8714.tar.gz
rails-6c1c16bfd9eb865dffa68c12c7df66d5a59a8714.tar.bz2
rails-6c1c16bfd9eb865dffa68c12c7df66d5a59a8714.zip
Fixes a subtle bug when using symbols for key definitions in habtm associations
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
index d4143e0645..4fa8e9d0a8 100644
--- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
@@ -35,10 +35,10 @@ module ActiveRecord
columns = @owner.connection.columns(@reflection.options[:join_table], "#{@reflection.options[:join_table]} Columns")
attributes = columns.inject({}) do |attrs, column|
- case column.name
- when @reflection.primary_key_name
+ case column.name.to_s
+ when @reflection.primary_key_name.to_s
attrs[column.name] = @owner.quoted_id
- when @reflection.association_foreign_key
+ when @reflection.association_foreign_key.to_s
attrs[column.name] = record.quoted_id
else
if record.has_attribute?(column.name)