# Self referential has\_many through w/ uniq not working

**URL:** <https://www.ruby-forum.com/t/self-referential-has-many-through-w-uniq-not-working/92307>\
**Category:** Rails\
**Created:** [April 18, 2007, 2:54am UTC](https://www.ruby-forum.com/t/self-referential-has-many-through-w-uniq-not-working/92307 "2007-04-18T02:54:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [April 18, 2007, 2:54am UTC](https://www.ruby-forum.com/t/self-referential-has-many-through-w-uniq-not-working/92307/1 "2007-04-18T02:54:10Z")

</div>

After I patched my rails to allow me to use the “\<\<” operation on  
has\_many through WITH a self referential relationship, I ran into  
another issue:

:uniq=\> true does not prohibit me from creating a second record in the  
database.

Has anyone experienced this or has a work around? BTW, Im using Rails  
1.2.
