Hello, I''m trying to delete all rows with an older than current timestamp... However, my code is not working... It looks like this: @currenttime = Time.now Import.delete_all(["created_at < ?", @currentime]) where created_at is an automatically created timestamp in the form 2008-01-18 10:24:47. I was thinking that perhaps it is not working because it should be in UNIX timestamp format? If so, how can I do that? My code isn''t throwing any exceptions or anything. Thank you very much, - Jeff -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> @currenttime = Time.now > Import.delete_all(["created_at < ?", @currentime])don''t know if you copy/pasted that code. there''s a typo @currenttime/@currentime, so it would check against nil -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ooooooooh man, I feel retarded now. It works perfectly... Thanks for pointing that out! Thorsten Mueller wrote:>> @currenttime = Time.now >> Import.delete_all(["created_at < ?", @currentime]) > > don''t know if you copy/pasted that code. there''s a typo > @currenttime/@currentime, so it would check against nil-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---