25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

13 lines
231 B

  1. class FillPriceInLineItems < ActiveRecord::Migration[5.0]
  2. def up
  3. LineItem.all.each do |item|
  4. product = Product.find(item.product_id)
  5. item.price = product.price
  6. item.save!
  7. end
  8. end
  9. def down
  10. end
  11. end