I’m hung up on this same problem, on the same platform, save for the
that I’m using rails 1.1.4 and corresponding versions of its libraries.
I took Travis’ suggestion, but extended it a bit, to make a good effort
insure that it returns the desired record:
#my class is called Itinerary, and uses the created_at convention,
write_attribute( ‘id’, Itinerary.find( :first, :select => ‘id’,
:conditions => [“name = ? and created_at = ?”, self.name,
This works, but it’s pretty ugly, and not 100% safe: what if two users
an Itinerary named “Trip to Houston” within one second of each other?
David R. (doppler)