fix deprecation warnings

This commit is contained in:
Reinier Balt 2013-09-13 16:44:59 +02:00
parent b343d0a09e
commit eaa66be698
19 changed files with 37 additions and 33 deletions

View file

@ -4,7 +4,7 @@ class ConvertProjectToStateMachine < ActiveRecord::Migration
def self.up
add_column :projects, :state, :string, :limit => 20, :default => "active", :null => false
@projects = Project.find(:all)
@projects = Project.all
@projects.each do |project|
project.state = project.done? ? 'completed' : 'active'
project.save
@ -14,7 +14,7 @@ class ConvertProjectToStateMachine < ActiveRecord::Migration
def self.down
add_column :projects, :done, :integer, :limit => 4, :default => 0, :null => false
@projects = Project.find(:all)
@projects = Project.all
@projects.each do |project|
project.done = project.state == 'completed'
project.save