You're doing it wrong. You should never try to access data from database when
constructing models (or load modules) since there is no guarantee that "Module" model
is completely initialized and working properly.
Since you don't provide more details I assume that you try to have dynamic from Module to
fill choices. There are two fundamental problems first is what happens above and second
is that campaign_modules is only evaluated _once_ in lifetime of a CampaignTemp model. So
if you change active status of modules they're not reflected to that list.
You need to provide more context of your model so we can help with proper solution.
--
Jani Tiainen