Hi,
another probably easy to answer question for those of you who know what
they are doing :).
Situation is the same as describted in
http://thread.gmane.org/gmane.comp.lang.ruby.rails/22154
Now that I finally have the belongs_to at the right place other problems
occour.
1. Do I have to put a belongs_to, has_many ... on each side of the
connection? Or is a X belongs_to Y enough and the Y has_many X unnessesary?
2. What about pluralization? I use the model-name as attribute, right? In
singular or plural?
3. How do I easily test if the new functions that the belong_to created are
up and running?
4. Finnaly the error I get when trying to create a new DB-Entry. What am I
doing wrong?
#23000Cannot add or update a child row: a foreign key constraint fails:
INSERT INTO tents (`name`, `date_update_at`, `desc`, `tent_type_id`,
`creator_dealer_id`) VALUES(''Alabama'', ''2005-09-19
16:48:00'', ''asdf'', 0, 0)
Thanks a lot!
~Tobias
--
Weblog: http://flyingsparks.wwwfiles.de/