Robert Dober
5/1/2007 7:15:00 AM
On 5/1/07, Yaxm Yaxm <snowstorm+rubyforum@gmail.com> wrote:
> Rober,
> converting the date object to be a time can cause the exception:
> >> birth_date(50)
> => #<Date: 4871917/2,0,2299161>
> >> birth_date(50).to_time
> ArgumentError: argument out of range
>
> Time.new().years_ago(50) causes the same exception
>
Why do you use Time? Does Date not do the job?
#years_ago is a method of the ActiveRecord extension of Date.
I guess we might not be talking about the same thing, maybe if you
post more code?
But look at Nobu's suggestion, seems to work just fine.
Cheers
Robert
--
You see things; and you say Why?
But I dream things that never were; and I say Why not?
-- George Bernard Shaw