Agile Tortoise

Greg Pierce’s blog

« RFC: Reading material      Slicehost: installing imagemagick »

Rails: model == file

If you’re thinking about saving yourself a few files by placing a couple of model classes in the same file in your Rails app, think again. It seems that Rails load structure (at least in recent versions) will puke on that setup.

I was using Single Table Inheritance, and it seems a good idea — instead I spent a hour troubleshooting an “uninitialized constant” error. Once I split the classes into their own model files I was fine.

Wednesday, March 14th, 2007 at 9:10 pm and is filed under Ruby on Rails. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply