Displaying 1 result from an estimated 1 matches for "artists_genres".
2005 Dec 15
2
HABTM being tricky
...ny :collections
has_and_belongs_to_many :genres
end
when I put it at the end of the list, there''s only one artist per genre
for some reason. I switch it back and forth several times importing from
an XML with the same results - the 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...