mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-29 20:26:11 +01:00
fix deprecation warnings
This commit is contained in:
parent
b343d0a09e
commit
eaa66be698
19 changed files with 37 additions and 33 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue