[Nitro] RES: updated_at and created_at

Antoniolo antoniolo at gmail.com
Thu Mar 15 08:40:25 EDT 2007


Omg!, thanks ... :^

How about the String/Text ?


-----Mensagem original-----
De: nitro-general-bounces at rubyforge.org
[mailto:nitro-general-bounces at rubyforge.org] Em nome de George Moschovitis
Enviada em: Thursday, March 15, 2007 9:10 AM
Para: General discussion about Nitro
Assunto: Re: [Nitro] updated_at and created_at

This is already available in Og:

class Article
  is Timestamped
end

a = Article.new
a.save
a.create_time
a.update_time
a.access_time

there is also TimestampedOnCreate

-g.




On 3/15/07, Antoniolo <antoniolo at gmail.com> wrote:
> 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.
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>


-- 
http://blog.gmosx.com
http://cull.gr
http://www.joy.gr
http://nitroproject.org
_______________________________________________
Nitro-general mailing list
Nitro-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/nitro-general



More information about the Nitro-general mailing list