Skip to content

Commit

Permalink
fix old migration for Rails 2.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jweiss committed Nov 17, 2009
1 parent 3411dad commit 937758f
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions db/migrate/018_move_recipes_to_stages.rb
@@ -1,34 +1,11 @@
class Recipe < ActiveRecord::Base
has_and_belongs_to_many :recipes
has_many :stages
end

class Stage < ActiveRecord::Base
has_and_belongs_to_many :recipes
belongs_to :project
end

class Recipe < ActiveRecord::Base
has_and_belongs_to_many :projects
has_and_belongs_to_many :stages
end

class MoveRecipesToStages < ActiveRecord::Migration
def self.up

create_table "recipes_stages", :id => false, :force => true do |t|
t.integer "recipe_id"
t.integer "stage_id"
end

Recipe.find(:all).each do |r|
r.projects.each do |p|
p.stages.each do |s|
s.recipes << r
end
end
end


end

def self.down
Expand Down

0 comments on commit 937758f

Please sign in to comment.