5

Loading Fixtures in a Migration

Posted in Ruby on Rails at September 28th, 2006 / 5 Comments »

I love migrations. I think they are one of the best things about rails. I love that I can count on any changes I’ve done in the database to be consistent across all other databases that I use. Love it.

Sometimes I find that I want pre-load my database with some data, like categories that I have. For testing purposes, I have already created this data in my fixture; now I just want to load that fixture into my database from a migration call.

I know that there is a rake task for this, so I looked into that code and came up with a little something.

Read the rest of this entry »

0

Simply Restful Backport

Posted in Ruby on Rails at September 15th, 2006 / No Comments »

I desperately want to use edge rails to have all the goodies of Rails 1.2, especially the RESTful stuff. The problem is that it’s bleeding edge and I am working on a project that will be public and not for my own desires.

There is a simply_restful plugin available, which is what Rails 1.2 will be modeled after. The problem is that there will be differences between the plugin and the rails source. That means after using one, I have to refactor some code to include conventions like change my delete methods to destroy and some pluralizing stuff as well.

That’s where the simply_restful_backport plugin comes in. The author has made a plugin which implements the RESTful stuff as it will be in Rails 1.2. I am going to try it out this weekend and see how she fits.