public
Fork of mleung/feather
Description: The simplest blog that works. Make sure you check out the feather-plugins repo as well!
Clone URL: git://github.com/ivey/feather.git
Search Repo:
added a db task to auto migrate all core classes for feather (for initial 
database setup)
eldiablo (author)
Wed Jun 11 13:38:29 -0700 2008
commit  32187e0bc4d0d45ed19e32c8d06069561f4f8aa3
tree    7b554490f99c85ca9601a0b84888d38090d39697
parent  8ed62ce2ea67583e90ba0eb1fbd2d478b712b6cb
...
1
2
3
 
4
5
6
...
11
12
13
 
 
 
 
 
14
15
16
...
1
2
 
3
4
5
6
...
11
12
13
14
15
16
17
18
19
20
21
0
@@ -1,6 +1,6 @@
0
 module Database
0
   class << self
0
- CORE = [Activity, Article, Configuration, Plugin, User]
0
+ CORE = Dir.glob("app/models/*.rb").collect { |s| Class.const_get(s.split("/").last.gsub(".rb", "").split("_").collect { |w| w.capitalize }.join("")) }
0
     
0
     # This provides a helper method for data migration for plugins - we can then update this to use non-destructive migrations at a later date and existing plugins won't need to change
0
     def migrate(klass)
0
@@ -11,5 +11,10 @@ module Database
0
       # Execute auto migrations for now
0
       klass.auto_migrate!
0
     end
0
+
0
+ # This does the initial auto migration of all core classes
0
+ def initial_setup
0
+ CORE.each { |c| c.auto_migrate! }
0
+ end
0
   end
0
 end
0
\ No newline at end of file

Comments

    No one has commented yet.