George,

> The following code does not seem to work. After creating a new object
> the active_trip_id field is blank in the database. Any ideas what I'm
> doing wrong?

...

>     # Default activeTrip to itself if none specified:
>     before :save do
>       activeTrip ||= self
>     end

The first thing I'd try is prefix the assignment with self, eg:
self.activeTrip ||= self

Without that you're assigning to a local variable, not the object
accessor/mutator.

--

Dan
(dkubb)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to