title: Ruby on Rails: Properly creating a model instance that has relation to multiple models
body: <p>Let's say I have a standalone User model and Service model.</p>
  
  <p>I also have a Order model that holds the orders created by an user for a service. I'm wondering how I could properly create an order entry in rails.</p>
  
  <p>Here is how I'll create an order entry if it refers to only one other model, say user.</p>
  
  <pre><code>@order = current_user.orders.build(params[:order])
  @order.save
  </code></pre>
  
  <p>Now how do I do that if order refers to multiple models (user and service)?</p>
  
  <p>Assume that Order model has user_id and service_id attributes and all model objects are properly tagged with belongs_to and has_many relationships.</p>