public
Fork of tablatom/hobocentral
Description: Markdown sources for http://hobocentral.net
Homepage: http://hobocentral.net
Clone URL: git://github.com/drnic/hobocentral.git
Search Repo:
example for creating StoryStatuses
drnic (author)
Mon May 12 19:24:05 -0700 2008
commit  3596edb10e7e0a51399295fa868062ad97a19f74
tree    09d0aeebb622a2989c4498dcae4410f8dc69e896
parent  0014ebd5378c460bea1038266f7becc4598da0a6
...
489
490
491
492
 
 
 
 
 
 
 
 
493
494
495
...
489
490
491
 
492
493
494
495
496
497
498
499
500
501
502
0
@@ -489,7 +489,14 @@
0
 
0
 Once you've done that you'll see that the generated migration includes the creation of the new foreign key and the removal of the old status column. If you wanted to do something clever with the existing status values you're free to edit the migration and add some data processing before you run it.
0
 
0
-That's it. The page to manage the story statuses should appear in the main navigation.
0
+For example, within your migration, console or a rake task, you could create some initial story statuses
0
+
0
+ [:new, :accepted, :discussion, :implementation, :user_testing, :deployed, :rejected].each do |status|
0
+ StoryStatus.create :name => status.to_s
0
+ end
0
+{: .ruby}
0
+
0
+That's it. The page to manage the story statuses should appear in the main navigation once you restart your server.
0
 
0
 Now that we've got more structured statuses, let's do something with them...
0
 

Comments

    No one has commented yet.