On Sep 11, 2008, at 5:07 PM, Li Chen wrote:
Posted via http://www.ruby-forum.com/.
You could use migrations. But thats just another way of describing the
If you want another approach (defining a model and then letting the
layer create the required database), you could use datamapper
Then, you class will look like this:
1 class Post
2 include DataMapper::Resource
3 property :id, Integer, :serial => true
4 property :title, String
5 property :subtitle, String :lazy => [:show]
6 property :body, Text :lazy => [:show]
7 property :views, Integer, :lazy => [:show]
8 property :summary, Text
will create/migrate your table automatically.