# Anyway to get \<\< working with has\_many through in Rails 1.2?

**URL:** <https://www.ruby-forum.com/t/anyway-to-get-working-with-has-many-through-in-rails-1-2/92157>\
**Category:** Rails\
**Created:** [April 16, 2007, 7:01pm UTC](https://www.ruby-forum.com/t/anyway-to-get-working-with-has-many-through-in-rails-1-2/92157 "2007-04-16T19:01:08Z")\
**Posts on this page:** 2\
**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 16, 2007, 7:01pm UTC](https://www.ruby-forum.com/t/anyway-to-get-working-with-has-many-through-in-rails-1-2/92157/1 "2007-04-16T19:01:08Z")

</div>

Is there any way to get the edge rails feature that allows you to do use  
\<\< to add an object to a relationship, just like in the HABTM. I know  
Josh S. talked about about how someone released a fix for it, but it  
didnt seem to make it into Rails 1.2. Any ideas?

---

<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 17, 2007, 4:38am UTC](https://www.ruby-forum.com/t/anyway-to-get-working-with-has-many-through-in-rails-1-2/92157/2 "2007-04-17T04:38:28Z")

</div>

I tried extending the relationship, but this method seems a little  
hackish:

has\_many :through=\>x do

def \<\<(value)  
JoinTable.create()  
end  
end

However, Im having a little trouble getting the id for the object since  
its passing through another relationship. Any ideas.

Thanks in advance.
