search for: my_genre_name

Displaying 1 result from an estimated 1 matches for "my_genre_name".

2005 Dec 15
2
HABTM being tricky
...e first resulting correct relationships (99 records in artists_genres), while the second resulted in an artists_genres table containing 7 records - one for each genre. The way the records were inserted was with something like this: artist = Artist.new( my_arguments ) genre = Genre.find_by_name( my_genre_name ) unless genre genre = Genre.new( :name => my_genre_name ) end artist.genres << genre artist.save I _think_ I''m doing everything right, but if not I''m sure someone will let me know ;).. but anyway, has anyone run into a problem like that with HABTM before? -Pawel -...