views:

142

answers:

1

I have a model named Aggelia (it's greek for classified ad) and have set an inflection in RAILS_ROOT/config/initializers/inflections.rb like so:

ActiveSupport::Inflector.inflections do |inflect|
  inflect.irregular 'aggelia', 'aggelies'
end

It works fine in the development environment but when I try to run the tests (only assert truths right now) every test errors with:

test_the_truth(UserTest):
ActiveRecord::StatementInvalid: Mysql::Error: Table 'market_redux_test.aggelias' doesn't exist: DELETE FROM `aggelias`

Seems like rails does not load the inflections when running the tests (or at least not in time).

I am using ruby 1.8.7 on rails 2.3.3

Any ideas why this might be happening?

A: 

Found the bug.

Actually, the test environment loads the inflections just fine, the problem was a forgotten aggelias.yml which was created by script/generate model (possibly before I wrote the inflection rule) and triggered the search for an aggelias table.

relevant lighthouse ticket

vrinek