# Has\_many :through problem

**URL:** <https://www.ruby-forum.com/t/has-many-through-problem/131581>\
**Category:** Rails\
**Created:** [March 11, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/has-many-through-problem/131581 "2008-03-11T16:12:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [March 11, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/has-many-through-problem/131581/1 "2008-03-11T16:12:42Z")

</div>

Hello all,

I have the following structure,

a Profile model which has\_many :knowledges, :through  
=\> :knowledges\_profiles  
a Knowledge model has\_many :profiles, :through =\> :knowledges\_profiles  
and KnowledgeProfile model, and a table knowledges\_profiles which is  
setted by set\_table\_name …

in the console, when I find the profile 1, I see the “knowledge\_ids”  
and “knowledges” methods but I can call them, cause it returns an  
error that can´t find the HasManyThrough Association  
knowledges\_profiles in the profile model.

Somebody can help me?

---

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [March 11, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/has-many-through-problem/131581/2 "2008-03-11T17:24:28Z")

</div>

On 11 Mar 2008, at 15:11, flaubert wrote:

> in the console, when I find the profile 1, I see the “knowledge\_ids”  
> and “knowledges” methods but I can call them, cause it returns an  
> error that can´t find the HasManyThrough Association  
> knowledges\_profiles in the profile model.

does KnowledgeProfile (it’s super awesome if you can come up with a  
better name for things like this) has the right associations  
(belongs\_to profile & knowledge).

Fred

---

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [March 11, 2008, 10:06pm UTC](https://www.ruby-forum.com/t/has-many-through-problem/131581/3 "2008-03-11T22:06:42Z")

</div>

yeah! it all ok… I Can´t understand why this happens!
