title: Rails update nested attributes in console
body: <p>I have two models:-</p>
  
  <pre><code>class Order &lt; ApplicationRecord
    has_many :order_items, inverse_of: :order, dependent: :destroy
    after_update :update_qantity
    def update_quantity
     self.order_items.each do |oi|
      if oi.saved_change_to_quantity?
        #some logic
      end
    end
  
  end
  </code></pre>
  
  <p>and </p>
  
  <pre><code>class OrderItem &lt; ApplicationRecord
    belongs_to :order, inverse_of: :order_items
  end
  </code></pre>
  
  <p>Now, when I do this from rails console:-</p>
  
  <pre><code>ord = Order.first  
  ord.order_items.first.update_attributes(quantity: 101)
  ord.save!
  </code></pre>
  
  <p>The control does go inside update_quantity method, but saved_change_to_quantity? is false(tested by byebug). How should I update nested attributes, so that control does go inside the if statement.</p>