Join tables with additional columns on top of the two foreign keys must be considered ambiguous unless a select clause has been explicitly defined. Otherwise you can get broken records back, if, for example, the join column also has an id column. This will then overwrite the id column of the records coming back.
# File activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb, line 96 def finding_with_ambiguous_select?(select_clause) !select_clause && @owner.connection.columns(@reflection.options[:join_table], "Join Table Columns").size != 2 end