rails/rails — pull request #17426 by jpcody (2014-10-29 13:04:25+00:00)
Title: Rely on through table name in has_many fixtures

The fixtures code always builds join table names via the association's [`join_table`](https://github.com/jpcody/rails/blob/8e16a00de4f77f15e405d083d535b92a23779d9d/activerecord/lib/active_record/fixtures.rb#L685) method, which will use [`derive_join_table`](https://github.com/jpcody/rails/blob/8e16a00de4f77f15e405d083d535b92a23779d9d/activerecord/lib/active_record/reflection.rb#L566) to build the table name via convention. But in the event a join table was created with a different table name, this will fall down. Using the `through_association#table_name` makes an affordance for both of these cases.

I think the existing code works from for the `ReflectionProxy` but should be overridden for the `HasManyThroughProxy` to handle if the table name is either overridden in the model or created with a different table name.