aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-10-15 16:27:13 +0100
committerJon Leighton <j@jonathanleighton.com>2010-10-15 16:27:13 +0100
commitd619e399380cd840f9f5ec88bb3d823fbb1f4d08 (patch)
tree4eb3c205b0a63bb087938061d1b9a0a4de34dbad /activerecord/lib/active_record
parent1e2525bfe0248d873d6d6026f45102853a1c95cd (diff)
downloadrails-d619e399380cd840f9f5ec88bb3d823fbb1f4d08.tar.gz
rails-d619e399380cd840f9f5ec88bb3d823fbb1f4d08.tar.bz2
rails-d619e399380cd840f9f5ec88bb3d823fbb1f4d08.zip
Fix small bug which was shown by the last commit
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 2a72fa95c9..22a693540e 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -2246,7 +2246,7 @@ module ActiveRecord
end
def table
- if reflection.macro == :has_and_belongs_to_many
+ if @tables.last.is_a?(Array)
@tables.last.first
else
@tables.last