When direct recommendation-indicator relationships were introduced, the
indirect relationships were initially lost. Those were needed to trigger
overdue emails to category managers.
We put a workaround in place in #386 but recognised the need for a
cleaner solution.
Changes
This commit tidies up the way that we source indicators for
recommendations and subsequently for categories and their due dates.
Considerations
Initially I tried to create an ActiveRecord has_many on Recommendation
that contained all of the indicators from both direct relations and
those from the measures. Unfortunately I wasn't successful in getting
that working; so far as I can tell it's not a supported behaviour.
Instead, I've used instance methods on the Category and Recommendation
models to build the collections that we need for our current features.
Context
https://github.com/impactoss/impactoss-server/issues/385
When direct recommendation-indicator relationships were introduced, the indirect relationships were initially lost. Those were needed to trigger overdue emails to category managers.
We put a workaround in place in #386 but recognised the need for a cleaner solution.
Changes
This commit tidies up the way that we source indicators for recommendations and subsequently for categories and their due dates.
Considerations
Initially I tried to create an ActiveRecord
has_many
on Recommendation that contained all of the indicators from both direct relations and those from the measures. Unfortunately I wasn't successful in getting that working; so far as I can tell it's not a supported behaviour.Instead, I've used instance methods on the Category and Recommendation models to build the collections that we need for our current features.