Closed tkellen closed 13 years ago
@tkellen: a default like this will be evaluated when the class is, so your're essentially hard-coding the date/time in your model. What you want to use is a proc: :default => proc { DateTime.now }
. This will be evaluated each time an object is created.
See the section titled "Setting default values" in http://datamapper.org/docs/properties.html for more information.
...the actual date/time is set correctly when creating records but this schema will not play nicely with apps that interact with the database through some other method.