search for: find_by_horse_id

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

2010 May 11
1
has_one/belongs_to -- accessing the subordinate
...nil # whoa, nellie! where''s your carriage??? ======== ... despite this, a carriage really was created for nellie: ======== >> nellie => #<Horse id: 9, created_at: "2010-05-11 16:27:11", updated_at: "2010-05-11 16:27:11"> >> Carriage.find_by_horse_id(nellie.id) => #<Carriage id: 9, created_at: "2010-05-11 16:27:11", updated_at: "2010-05-11 16:27:11", horse_id: 9> ======== I can imagine why this is happening: Calling horse.carriage caches a value and doesn''t bother to re-check the database after the save!....