# has\_many :through problem

**URL:** <https://discuss.rubyonrails.org/t/has-many-through-problem/26147>\
**Category:** rubyonrails-talk\
**Created:** [March 11, 2008, 3:11pm UTC](https://discuss.rubyonrails.org/t/has-many-through-problem/26147 "2008-03-11T15:11:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaubert](https://avatars.discourse-cdn.com/v4/letter/f/858c86/32.png) [@flaubert](https://discuss.rubyonrails.org/u/flaubert)\
**Post date:** [March 11, 2008, 3:11pm UTC](https://discuss.rubyonrails.org/t/has-many-through-problem/26147/1 "2008-03-11T15:11:22Z")

</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:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [March 11, 2008, 4:23pm UTC](https://discuss.rubyonrails.org/t/has-many-through-problem/26147/2 "2008-03-11T16:23:46Z")

</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.

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://avatars.discourse-cdn.com/v4/letter/f/858c86/32.png) [@flaubert](https://discuss.rubyonrails.org/u/flaubert)\
**Post date:** [March 11, 2008, 9:06pm UTC](https://discuss.rubyonrails.org/t/has-many-through-problem/26147/3 "2008-03-11T21:06:04Z")

</div>

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