# TypeError Conversion on has\_many relationship

**URL:** <https://www.ruby-forum.com/t/typeerror-conversion-on-has-many-relationship/166698>\
**Category:** Rails\
**Created:** [April 28, 2009, 5:16pm UTC](https://www.ruby-forum.com/t/typeerror-conversion-on-has-many-relationship/166698 "2009-04-28T17:16:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![niczm25](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ce73a5/32.png) [@niczm25](https://www.ruby-forum.com/u/niczm25)\
**Post date:** [April 28, 2009, 5:16pm UTC](https://www.ruby-forum.com/t/typeerror-conversion-on-has-many-relationship/166698/1 "2009-04-28T17:16:25Z")

</div>

I have a couple of objects in a Rails app (“Ticket”, and “Comment”)

class Ticket \< ActiveRecord::Base  
has\_many :attributes  
has\_many :comments  
end

class Comment \< ActiveRecord::Base  
belongs\_to :ticket  
belongs\_to :user  
end  
with the following schema:

create\_table “comments”, :force =\> true do |t|  
t.integer “ticket\_id”  
t.integer “user\_id”  
t.text “content”  
t.datetime “created\_at”  
t.datetime “updated\_at”  
end

create\_table “tickets”, :force =\> true do |t|  
t.integer “site\_id”  
t.integer “status”  
t.integer “user\_id”  
t.datetime “created\_at”  
t.datetime “updated\_at”  
end  
However, for some reason - whenever I do a @lead.comments I get a  
crash:

can’t convert String into Integer

Any ideas? This is driving me nuts!
