aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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