I'm working on a Rails 4 App where there is a model called Apps. Each App can have multiple certificates which are stored in the Certificates model. Out of the certificates each App can have a development and a production certificate which are then active for the current App. At a single given time only two certificates (development/production) can be active for the App. I'm trying to come up with an ActiveRecord structure for this logic but I'm lost. Any suggestions on this?
Apps (Has Many certificates)
- development_certificate
- production_certificate
Certificates (Belongs to App)