views:

133

answers:

2

How to write the :condition statement if I would like to get all the record which are created today?

+1  A: 
Model.all :condition => ["DATE(created_at) = DATE(?)", Time.now]
jigfox
thanks buddy. :)
siulamvictor
+3  A: 
 ModelName.all :condition => ["DATE(created_at) = DATE(?)", Time.now]
piemesons
thanks buddy. :)
siulamvictor
@siulamvictor no problem dude. If your problem is solved them pack up the question by accepting the answer
piemesons