# Has\_many through generated SQL column names incorrect

**URL:** <https://www.ruby-forum.com/t/has-many-through-generated-sql-column-names-incorrect/57812>\
**Category:** Rails\
**Created:** [April 14, 2006, 1:57pm UTC](https://www.ruby-forum.com/t/has-many-through-generated-sql-column-names-incorrect/57812 "2006-04-14T13:57:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjrussell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jjrussell](https://www.ruby-forum.com/u/jjrussell)\
**Post date:** [April 14, 2006, 1:57pm UTC](https://www.ruby-forum.com/t/has-many-through-generated-sql-column-names-incorrect/57812/1 "2006-04-14T13:57:20Z")

</div>

I just saw a post on this a few days ago but I’ve been searching and  
can’t find it again. I have a has\_many, through relationship, but when  
I try to :include the join table in a

Model.find(:all, :conditions =\> “join\_table.column = something”,  
:include =\> “join\_table”)

the generated sql contains this where “grant\_ownerships” is the join  
table and “grants” is one of the tables it is joining.

…

LEFT OUTER JOIN grant\_ownerships grant\_ownerships\_grants ON  
grant\_ownerships\_grants.grant\_id = grants.id

See how there are underscores where there should be periods?  
Is there a fix for this?

Sorry for the repeat question.
