diff --git a/db/migrate/20150423144533_add_block_to_environment_and_profile.rb b/db/migrate/20150423144533_add_block_to_environment_and_profile.rb new file mode 100644 index 0000000..5c8ca0b --- /dev/null +++ b/db/migrate/20150423144533_add_block_to_environment_and_profile.rb @@ -0,0 +1,15 @@ +class AddBlockToEnvironmentAndProfile < ActiveRecord::Migration + def up + Environment.all.each do |env| + env.boxes << Box.new if env.boxes.count < 4 + end + + Profile.all.each do |profile| + profile.boxes << Box.new if profile.boxes.count < 4 + end + end + + def down + say "this migration can't be reverted" + end +end -- libgit2 0.21.2