[Rails] Re: Compare timestamps

2009-06-10 Thread Bruno Sousa
Okay, another issue: There are persons with the same names. I need to group them by their names and add their age(the ones that have same name). this table: --- NAME | AGE John | 23 Abe | 45 Amy | 40 John | 7 John | 5 Amy | 5 --- would turn into --- NAME | AGE

[Rails] Re: Compare timestamps

2009-06-10 Thread Bruno Sousa
Thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe fr

[Rails] Re: Compare timestamps

2009-06-10 Thread Maurício Linhares
Person.all( :conditions => [ 'created_at BETWEEN ? AND ?', Time.now.at_beginning_of_day, Time.now.at_beginning_of_day + 1.day ] ) - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Jun 10, 2009 at 3:46 PM, Bruno Sousa wrote: > > Hi everyone, > 'Person

[Rails] Re: Compare timestamps

2009-06-10 Thread Frederick Cheung
On Jun 10, 7:46 pm, Bruno Sousa wrote: > Hi everyone, > 'Person' migration includes timestamps. > I want to find every person created 'today'. > > Tried the command below, but I think it compares hour,minute and seconds > too. I just want to compare day,month and year. > Person.find(:all, :cond