Commit 59c6019c5929a7349aeba354395284bf9865d83f

Authored by Thiago Ribeiro
Committed by Rodrigo Souto
1 parent 49914a4d

Migrate for add the fourth box.

Migrate for add the fourth box to existing enviroments and profiles.

Signed-off-by: Thiago Ribeiro <thiagitosouza@hotmail.com>
db/migrate/20150423144533_add_block_to_environment_and_profile.rb 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +class AddBlockToEnvironmentAndProfile < ActiveRecord::Migration
  2 + def up
  3 + Environment.all.each do |env|
  4 + env.boxes << Box.new if env.boxes.count < 4
  5 + end
  6 +
  7 + Profile.all.each do |profile|
  8 + profile.boxes << Box.new if profile.boxes.count < 4
  9 + end
  10 + end
  11 +
  12 + def down
  13 + say "this migration can't be reverted"
  14 + end
  15 +end
... ...