The following code evaluates that the time being parsed is greater than 30 days ago.
Time.parse("2011-01-03T14:31:57Z") < 30.days.ago
=> true
Why is this true? It looks to me like the < is going the wrong way, and ought to be >. What am I missing?
30.days.agois a time, that time being 30 days ago. You’re seeing if your time is earlier than 30 days ago, and it is.So, don’t read it as “less than 30 days ago”, read it as “before 30 days ago”, or “earlier than 30 days ago”.