O Course não possui Environment, pois o mesmo é criado via accepts_nested_attributes_for :course no core. Quando o callback after_create de Course é chamando, o environment que está na memória não possui o ID [1].
Como há uma validação de environment_id no portal de aplicativos, o mesmo não é salvo quando o esperado é que fosse salvo.
A solução ideal seria garantir que o core seja capaz de gerar eventos com entidades válidas/consistentes.
Ao criar um curso pelo passo a passo do core, o seguinte evento chega pelo Untied:
O Course não possui Environment, pois o mesmo é criado via
accepts_nested_attributes_for :course
no core. Quando o callback after_create de Course é chamando, o environment que está na memória não possui o ID [1].Como há uma validação de environment_id no portal de aplicativos, o mesmo não é salvo quando o esperado é que fosse salvo.
A solução ideal seria garantir que o core seja capaz de gerar eventos com entidades válidas/consistentes.
[1] http://stackoverflow.com/questions/2226747/rails-accepts-nested-attributes-for-child-doesnt-have-parent-set-when-validatin
O log completo de apps:
O log do core: