开发者

Ruby on Rails: comparing dates error?

开发者 https://www.devze.com 2023-01-07 00:07 出处:网络
undefined method `<\' for nil:NilClass the line the error 开发者_JAVA技巧occurs on @object.expires_at < Date.today
undefined method `<' for nil:NilClass

the line the error 开发者_JAVA技巧occurs on

@object.expires_at < Date.today

so.. how do I compare dates?


I just upgraded to rails 2.3.8 from 2.3.4..

this fixed it

@object.expires_at < Date.today unless @object.expires_at.nil?
0

精彩评论

暂无评论...
验证码 换一张
取 消