search for: another_player

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

2006 Apr 10
6
Object isn''t being saved when called through association
I have three models in this small game I''m working on - the Game, Players, and Turns. A Player should be able to rescue another Player on any given turn. So it looks like this: class Game has_many :players has_many :turns def rescue_player(p) t = turns.last t.rescued = p t.save end end class Turn belongs_to :rescued, :foreign_key =>