Store default Spotlights on InstitutionGroup
Now that we have cleaned up the InstitutionGroup configurations, here's how I see the "default Spotlight configs" issue sorting out.
We've discusses storing defaults on the InstitutionGroup
, and now that the Institution relation is single-valued, this should be possible.
The SpotlightConfig
can be turned into a polymorphic relation, allowing us to save SpotlightConfig records on the InstitutionGroup
- following the same add_spotlight_configs
logic as we do with institutions after_create
.
We'll then be able to do this in our forms and indexing blocks:
institution = Institution.find_by(code: 'ath1') # ACC Libs
institution.institution_group.spotlight_configs.first # returns 'default' config with 'default' spotlight resources/links
institution.spotlight_configs.first # returns ACC Libraries custom customizations