-
Notifications
You must be signed in to change notification settings - Fork 2
/
38-story-status-model-migration-edit.patch
31 lines (22 loc) · 1.19 KB
/
38-story-status-model-migration-edit.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
story-status-model-migration-edit
From: Bryan Larsen <[email protected]>
You can always edit the migration before running it. For example you could create some initial story statuses by adding this code to the `self.up` method:
SHOW_PATCH
That's it. The page to manage the story statuses should appear in the main navigation.
Now that we've got more structured statuses, let's do something with them...
---
...1201134408_hobo_migration_story_status_model.rb | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/db/migrate/20091201134408_hobo_migration_story_status_model.rb b/db/migrate/20091201134408_hobo_migration_story_status_model.rb
index 8571591..08b81fa 100644
--- a/db/migrate/20091201134408_hobo_migration_story_status_model.rb
+++ b/db/migrate/20091201134408_hobo_migration_story_status_model.rb
@@ -11,6 +11,9 @@ class HoboMigrationStoryStatusModel < ActiveRecord::Migration
add_column :stories, :status_id, :integer
remove_column :stories, :status
add_index :stories, [:status_id]
+
+ statuses = %w(new accepted discussion implementation user_testing deployed rejected)
+ statuses.each { |status| StoryStatus.create :name => status }
end
def self.down