# Uninitialized constant error - Using unconventional table names

**URL:** <https://www.ruby-forum.com/t/uninitialized-constant-error-using-unconventional-table-names/159669>\
**Category:** Rails\
**Created:** [February 6, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-error-using-unconventional-table-names/159669 "2009-02-06T21:46:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![loominator1970](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6f9a4e/32.png) [@loominator1970](https://www.ruby-forum.com/u/loominator1970)\
**Post date:** [February 6, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-error-using-unconventional-table-names/159669/1 "2009-02-06T21:46:54Z")

</div>

Hello,

I’m having some trouble with an association between two tables in my  
RoR site. It looks like Rails is attempting to truncate the name of  
my model so that it can fit the normal model conventions. Any idea  
how I can override this?

The error:

uninitialized constant Project::ProjectProgres ( i think its  
truncating the ‘s’ off ‘project\_progress’ to fit conventions)

The models (and associations)

#### …/models/project\_progress.rb

class ProjectProgress \< ActiveRecord::Base  
set\_table\_name “project\_progress”  
belongs\_to :project

#### …/models/project.rb

class Project \< ActiveRecord::Base  
has\_many :project\_progress

#### …/controllers/project\_controllers.rb

…  
@project.project\_progress.each do |p| ## this is the line its  
puking on  
# some code  
end

Any idea where to set the override statement?

Dave

---

<div class="post-metadata">

**Author:** ![loominator1970](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6f9a4e/32.png) [@loominator1970](https://www.ruby-forum.com/u/loominator1970)\
**Post date:** [February 7, 2009, 1:39pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-error-using-unconventional-table-names/159669/2 "2009-02-07T13:39:12Z")

</div>

On Feb 6, 8:46 pm, loominator1970 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> truncating the ‘s’ off ‘project\_progress’ to fit conventions)  
> has\_many :project\_progress  
> A has\_many should always use a plural form , regardless of what the  
> underlying table name is, so has\_many :project\_progresses should work  
> nicer. If Rails cannot properly infer the class name from the  
> association name you can:

- fiddle with the inflection rules so that rails knows how to  
singularize/pluralize these words
- use the :class\_name option

Fred
