you definitely have a few approaches, which is why I like rails && Rubin. In any case, do not forget about the "Law on Demeter" , so I will go with the following:
class User # ... methods and other active record stuff def created_today? self.created_at.to_date == Date.today end end
and you can see if the user is created today with the following api,
if User.find(params[:id]).created_today? #do something...
source share