Main Contents

Project Railsway - a TV Series idea

December 11, 2007

Tonight I was watching “Project Runaway” which is a television series that collects 12 aspiring clothing designers to compete in a series of challenges and the top 3 finalists get to show their collection of designs in front of fashion industry professionals at a fashion week event. Each challenge has a time limit and [...]

Filed under: Ruby on Rails | Comments (1)

Validates_uniqueness_of and single table inheritance

May 18, 2007

If you’re using STI (single table inheritance) with some Ruby on Rails models, and you need to make sure some fields are unique across all the models, you can use validates_uniqueness_of in the parent model using the :scope option to apply it to all the models. So in this instance since you have a [...]

Filed under: Ruby on Rails | Comments (0)

Making Rake tasks ignore Rails observers

May 16, 2007

Have you ever run “rake db:migrate” on an empty database (or you did “rake db:migrate VERSION=0″ to empty the database). And then it fails on you like this?

rake db:migrate
(in /Users/foucist/rails/myproject)
rake aborted!
Mysql::Error: #42S02Table ‘myproject_development.users’ doesn’t exist: SHOW FIELDS FROM users
(See full trace by running task with –trace)

Invariably, rake failures are caused by something in the [...]

Filed under: Ruby on Rails | Comments (1)