@anolson test for missing RAILS_ENV here :) It does make the table name a little ugly (there are two consecutive underscores without a RAILS_ENV) but it works as expected.