Rails ERD - Help with model

Hello i have some errors in generating ERD from models.. I guess i have
wrong associations.. please look at it

[DB]

orders

You’ve deviated from the Rails conventions, which you can do, but then you have to tell ActiveRecord how to handle it. Rails expects model names to have a singular form, and table names to be the plural of that name. For example, if the table name is users, it expects a model named User. If the model name is Product, it’s expecting the table name to be Products.

In your case, you’ve set up products_orders (the plural) as both the model name and the table name. It’s seeing the table name products_orders, which conforms to its expectations, and is expecting a model name ProductsOrder (the singular) which it can’t find.

Thank you it works now