title: Rails not getting value from associations
body: <p>I have 2 tables named : <code>order_items</code> and <code>orders</code> in schema. Following is sample of my schema</p>
  
  <pre><code>create_table "orders", force: :cascade do |t|
   t.string "first_name"
   t.string "last_name"
   t.datetime "created_at", null: false
   t.datetime "updated_at", null: false
   t.string "token"
   t.decimal "sub_total"
   t.string "mobile"
   t.string "address"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>create_table "order_items", force: :cascade do |t|
   t.integer "order_id", null: false
   t.integer "item_id", null: false
   t.integer "quantity", null: false
   t.decimal "price", precision: 15, scale: 2, null: false
   t.datetime "created_at", null: false
   t.datetime "updated_at", null: false
  end
  </code></pre>
  
  <p>For Models,</p>
  
  <p><code>order.rb</code></p>
  
  <pre><code>has_many :order_items
  </code></pre>
  
  <p><code>order_item.rb</code></p>
  
  <pre><code>belongs_to :order
  belongs_to :item
  </code></pre>
  
  <p>I thought I would have been able to get <code>Order.orderitem.quantity</code> with this association, but not able to get it. I get error as <code>undefined method 'orderitems' for nil:NilClass</code></p>