- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
@timestart = MyModel.lastUpdateTime - 1.hour
day = "#{@timestart.day}"
day = "0#{day}" if day.size<2
mon = "#{@timestart.mon}"
mon = "0#{mon}" if mon.size<2
start1 = "'#{@timestart.year}-#{mon}-#{day} #{@timestart.hour}:#{@timestart.min}:#{@timestart.sec}'"
a = MyModel.find(:all, :conditions=>[ "`datetime` > #{start1}" ]
malleus 27.07.2010 12:02 # 0
MyModel.all(:conditions => [" datetime > :timestart", { :timestart => MyModel.lastUpdateTime - 1.hour}])
vlad-druzh 29.07.2010 10:57 # 0
malleus 29.07.2010 12:28 # 0
P.S. camel case - это случайно или в проекте принято?
vlad-druzh 29.07.2010 12:50 # 0
malleus 12.08.2010 14:12 # +1