[Nitro] updated_at and created_at

Antoniolo antoniolo at gmail.com
Thu Mar 15 07:24:44 EDT 2007


Hi folks!

Those features are really handy. For those who are not familiar with that,
they are sorta auto-managed attributes. If you place them at your model, Og
will silently manage them:

earth = World.new
earth.save #updated_at, created_at => now
earth.something
earth.save #updated_at => now, created_at => first value

They can work with Date and Time.
Class World
  attr_accessor :created_at, Date or Time
  attr_accessor :updated_at Date or Time as well...
end

and they are only attr_reader.


I've got another question, why is attribute-type String directed mapped into
TEXT? Why not having a Text attribute-type? VarChar is fine, but it's more
DB-like than Ruby-like though.



More information about the Nitro-general mailing list