foodsoft/db/migrate/20090317175355_add_profit_to_orders.rb
Philipp Rothmann fb2b4d8a8a chore: rubocop
chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
2023-06-09 17:35:05 +02:00

13 lines
324 B
Ruby

class AddProfitToOrders < ActiveRecord::Migration[4.2]
def self.up
add_column :orders, :foodcoop_result, :decimal, precision: 8, scale: 2
Order.closed.each do |order|
order.update_attribute(:foodcoop_result, order.profit)
end
end
def self.down
remove_column :orders, :foodcoop_result
end
end