Displaying 1 result from an estimated 1 matches for "internal_dim_id".
2007 Oct 08
7
belongs_to association doesn't work with _id set
Hello there,
I''m developing an application which has models like this:
class Vehicle < ActiveRecord::Base
belongs_to :internal_dim, :class_name => "Dimension"
def before_create()
idim = Dimension.create
self.internal_dim_id = idim.id
#self.create_internal_dim # Doesn''t work
end
end
class Dimension < ActiveRecord::Base
has_one :vehicle
end
That is, creating the vehicle should create a dimension entry (yeah, i
know it''s strange, but actually dimension table is shared among
differen...