Hi all,
I''m having trouble updating the attributes of a join table
that''s used
in a habtm relationship. I can create new entries with
#push_with_attributes, but no matter what I do, I can''t seem to
generate
an sql UPDATE on the join table.
In my model, goats assign scores to boats. I have a join table called
"scores"
consisting of (goat_id, boat_id, score) tuples.
I have:
class Goat
has_and_belongs_to_many :scores, :join_table => "scores",
:class_name => "Boat"
def set_score_for boat, value
i = scores.index boat
if i.nil?
scores.push_with_attributes boat, :score => value
else
scores[i].score = value # doesn''t seem to do anything
boat.save # nope
save # nope
end
end
end
Am I missing something obvious?
Thanks for any help,
--
William <wmorgan-rubyonrails-xW3KcqxHEMnk1uMJSBkQmQ@public.gmane.org>