The first commit removes unused (and broken?) code that I found while looking at the association code. It was part of e6a47bcc and should not have been present.
The second commit refactors the extensions spec a bit to minimize the test classes being created for each test; this makes the tests more explicit and speeds them up slightly.
The final commit introduces the test from #239 and overrides the has_many method in any class that includes ActiveHash::Associations::ActiveRecordExtensions. The new implementation will adopt new behavior if the :through option is present and it points at an ActiveHash::Base class:
retrieving the join models (e.g., "Patient#appointments")
calling the :through association name on each join model (e.g., "Appointment#physician")
This PR closes #239.
The first commit removes unused (and broken?) code that I found while looking at the association code. It was part of e6a47bcc and should not have been present.
The second commit refactors the extensions spec a bit to minimize the test classes being created for each test; this makes the tests more explicit and speeds them up slightly.
The final commit introduces the test from #239 and overrides the
has_many
method in any class that includesActiveHash::Associations::ActiveRecordExtensions
. The new implementation will adopt new behavior if the:through
option is present and it points at anActiveHash::Base
class::through
association name on each join model (e.g., "Appointment#physician")Otherwise
has_many
will just callsuper
.