From d619e399380cd840f9f5ec88bb3d823fbb1f4d08 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 15 Oct 2010 16:27:13 +0100 Subject: Fix small bug which was shown by the last commit --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') 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 -- cgit v1.2.3