hi,\
how do i get all records form my model, which are not older than 3 days
? Say i have column in my users table ‘sign_in_date’, i want retrieve
all records with sign_in_date not older than 3 days from now.
thx
regards
hi,\
how do i get all records form my model, which are not older than 3 days
? Say i have column in my users table ‘sign_in_date’, i want retrieve
all records with sign_in_date not older than 3 days from now.
thx
regards
three_days_ago = (DateTime.now - 3.days)
YourModel.find(:all, :conditions => [‘sign_in_date > ?’,
three_days_ago])
Jean-Sébastien pisze:
three_days_ago = (DateTime.now - 3.days)
YourModel.find(:all, :conditions => [‘sign_in_date > ?’,
three_days_ago])
3.days lol
great stuff man
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs