Devise with many models and ArgumentError in RegistrationController#create

Hello! I write custom registration for different user types.

I have Devise model User and two models (roles) Company and Invidual:

I created UserObserver

Registration view: and partial (by default for Company)

In addition to the fields of User on the form displays the Name field of Company model.

But when I press the submit button, I get an error “ArgumentError in RegistrationController#create

Cannot build association character. Are you trying to build a polymorphic one-to-one association?

Application Trace | Framework Trace | Full Trace

app/controllers/registration_controller.rb:14:in `create’











How fix it? Thanks for your answers!

If there has_one :character in your model?

Maybe this can help you: