{"issue":{"created_at":"2011-12-08T22:40:19Z","state":"closed","updated_at":"2011-12-08T22:50:51Z","comments":1,"user":{"gravatar_id":"3bac4180a7bd7b0b6fd8a44c1c7452b7","id":570755,"url":"https://api.github.com/users/NielsKSchjoedt","avatar_url":"https://secure.gravatar.com/avatar/3bac4180a7bd7b0b6fd8a44c1c7452b7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"NielsKSchjoedt"},"body":"Hi I don't know if this is a bug, or if it's something that I should know of and handle myself. I'm running 3.1 and I'm in config.time_zone = 'Copenhagen' \r\n\r\nI have a job in resque that looks like this, when it's beeing queued:\r\n\r\n```ruby\r\nResque.enqueue(Lookups::Workers::CleaningJob, site, Time.now - 5.minutes)\r\n```\r\n\r\nNow, this stores a job like this in resque:\r\n\r\nCrawling::Workers::AdvertCleaningJob \t[\"Google\", \"2011-12-08T22:30:52+01:00\"]\r\n\r\nNow the problem shows, when I later run the queued job. The job executes a query, that uses the timestamp (in a variable called last_cleaned_time =  \"2011-12-08T22:30:52+01:00\")\r\n\r\n```ruby\r\nSite.where{(site == site_name) & (last_cleaned < last_cleaned_time)}\r\n```\r\n\r\nThis executes a query looking something like this:\r\n\r\n\r\n```sql\r\nSELECT \"sites\".* FROM \"sites\" WHERE ((\"sites\".\"site\" = 'Google' AND \"sites\".\"last_cleaned\" < '2011-12-08T22:30:52+01:00'))\r\n```\r\n\r\nAnd THAT is not what I want - the time has not been parsed correctly.\r\n\r\nIf I for testing do like this in the console:\r\n\r\n```ruby\r\nsite.update_attribute(:last_cleaned, \"2011-12-08T22:30:52+01:00\")\r\n```\r\n\r\nI can see from the resulting sql, that rails translates the time correctly\r\n\r\n```ruby\r\nUPDATE \"sites\" SET \"last_cleaned\" = '2011-12-08 21:30:52.000000', \"updated_at\" = '2011-12-08 22:14:30.632682' WHERE \"sites\".\"id\" = 12\r\n```\r\n\r\nSo in other words - I would have expected sqeel to handle this, just like rails, without doing a Time.parse() on the variable?","assignee":null,"id":2495418,"number":85,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"title":"Time.now from param in a resque job","html_url":"https://github.com/ernie/squeel/issues/85","closed_at":"2011-12-08T22:50:51Z","url":"https://api.github.com/repos/ernie/squeel/issues/85","milestone":null},"action":"closed"}