2011-12-22 92 views

回答

3
records = YourModel.where('xyz_at < updated_at') 
for record in records 
    puts record.updated_at, record.xyz_at 
end 
+0

我試圖做到這一點,但與xyz_at最初是零。這不起作用。除了將xyz_at默認爲過去的某種時間方式之外,還有更好的方法來處理這個問題嗎? 'self.xyz_at || = Date.new(1979,12,13)' – 2011-12-22 19:03:39

+1

'YourModel.where('xyz_at clyfe 2011-12-22 19:42:47

+0

非常感謝,夥伴。 – 2011-12-23 01:09:57

相關問題