From 8805079faa0ae5ccbebd8d6d43c4e0d3253ac3b3 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Fri, 3 Oct 2014 14:03:34 +1000 Subject: [PATCH] use attubutes instead of save! --- .../20140927005043_enterprise_config_refactor.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/db/migrate/20140927005043_enterprise_config_refactor.rb b/db/migrate/20140927005043_enterprise_config_refactor.rb index f7d120c469..3b3265333d 100644 --- a/db/migrate/20140927005043_enterprise_config_refactor.rb +++ b/db/migrate/20140927005043_enterprise_config_refactor.rb @@ -3,8 +3,7 @@ class EnterpriseConfigRefactor < ActiveRecord::Migration add_column :enterprises, :sells, :string, null: false, default: 'none' Enterprise.all.each do |enterprise| - enterprise.sells = sells_what?(enterprise) - enterprise.save! + enterprise.update_attributes({:sells => sells_what?(enterprise)}) end remove_column :enterprises, :type @@ -17,9 +16,10 @@ class EnterpriseConfigRefactor < ActiveRecord::Migration add_column :enterprises, :is_distributor, :boolean Enterprise.all.each do |enterprise| - enterprise.type = type?(enterprise) - enterprise.is_distributor = distributes?(enterprise) - enterprise.save! + enterprise.update_attributes({ + :type => type?(enterprise), + :is_distributor => distributes?(enterprise) + }) end remove_column :enterprises, :sells