one of Inventory, Inputs and Outputs, the question is who belongs to whom? Thinking in more detail, I deduce that inventory itself are products, therefore, these products belong to an Input, and the outputs always belong to Inputs? I would greatly appreciate it if you could help me clarify this doubt about this trio of models, Greetings!
Of course there could be many ways to do this, but maybe this will get you started.
Update based on comments:
More information on
has_many :through
: http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association