Displaying 1 result from an estimated 1 matches for "advertisement_id".
2007 Oct 07
1
activerecord problem with contrains,belongs_to and has_many keyword
Hi,
I have two models:
AdvertisementImages (table: advertisement_images)
Advertisement (table: advertisements)
The table advertisement_images has a foreign key to advertisements
called advertisement_id. Both tables has one entry where the entry in
dvertisement_images belongs to advertisement.
The model code looks lik this so far:
class AdvertisementImages < ActiveRecord::Base
file_column :image
belongs_to :advertisement
end
class Advertisement < ActiveRecord::Base
has_many :adverti...