Closed sandersiim closed 4 years ago
Totals | |
---|---|
Change from base Build 219: | -5.2% |
Covered Lines: | 549 |
Relevant Lines: | 580 |
Totals | |
---|---|
Change from base Build 219: | 0.0% |
Covered Lines: | 545 |
Relevant Lines: | 546 |
Totals | |
---|---|
Change from base Build 219: | 0.0% |
Covered Lines: | 545 |
Relevant Lines: | 546 |
Thanks @DmitryTsepelev!
Use relevant ActiveRecord::Associations::Association methods instead of relying on public_send. This allows application code to override behaviour of model generated association methods, without changing the behaviour of the
model.association().reader
method, when the association is "lazy preloaded".E.g for a model:
calling
Model.lazy_preload(:link).association(:link).reader
would currently print out 'application code'. This PR makes it so that it doesn't, which is the expected behaviour since that's how ActiveRecord.preload
behaves.This incompatibility initially blocked the gem usage in our codebase, but this patch solves the issue for us.