Forum: Ruby on Rails TypeError Conversion on has_many relationship

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Neil M. (Guest)
on 2009-04-28 19:16
(Received via mailing list)
I have a couple of objects in a Rails app ("Ticket", and "Comment")

class Ticket < ActiveRecord::Base
  has_many    :attributes
  has_many    :comments

class Comment < ActiveRecord::Base
  belongs_to :ticket
  belongs_to :user
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"

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"
However, for some reason - whenever I do a @lead.comments I get a

can't convert String into Integer

Any ideas? This is driving me nuts!
This topic is locked and can not be replied to.