Unable to change download policy

On foreman 1.19/katello 3.8 when I try to switch a repository from “on demand” to “immediate” I receive the error:

Could not update the repository:
undefined method `content_id’ for nil:NilClass
Did you mean? contains_erb?

I get the same error with the UI, the REST API and with hammer. What I can I do to fix this?

Created Issue # 25411 for this issue. @Justin_Sherrill do you think this is a result of the refactoring you did on this code? I see that content_id is delegated to root_repository.rb, but I don’t see anything for it there, but my ruby is not so good…

This doesn’t seem to happen on newly created repositories. Perhaps an issue with foreman-rake db:migrate? Re-running it did not seem to help.