Rails Testing Fixtures Extended

Posted by scientific on October 11, 2006

I have some meta-data stored in tables that I wanted to check with a unit test in Rails. I want to be sure that all the data are loaded correctly, every time. I have built some migration code that allows me to load YAML files directly into a SQL database (bypassing activerecord, unfortunately, because AR won’t let us specify which id is associated with which record: a critical necessity for lookup tables).

Continue reading…

Falafel with that?

Posted by scientific on October 09, 2006


Lunch: Pita or lavash bread
1 medium tomato (heirlooms are nice), diced
1 medium cucumber, peeled, seeds scraped, diced
1 smallish red bell pepper, seed/stem removed, diced
1/2 to 1 cup shredded cheese (try goat gouda, feta and cheddar together!)

Combine above salad ingredients into a bowl.
Heat your bread a little
Spread Hummus (roasted pepper hummus is nice) and Baba Ghanoush inside bread.
Add some salad.
Enjoy!

Rails Migrations explained

Posted by scientific on October 06, 2006

I’ve been learning about migrations in Rails. It’s basically a deployment system that is pretty well thought out. Some people say it’s not useful for production deployment but other credible people say they use it for production all the time – just be sure to test the deployment just like any other part of the application.
(This makes me think of a future article that would describe a testing harness for migration files – a little tricky since migrations run major Data Definition Langauge (DDL) changes and are executed “out of band” of the rest of Rails.

Continue reading…