Fixed test failure with sqlite (#8842).

git-svn-id: http://svn.redmine.org/redmine/trunk@12478 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2014-01-03 16:36:04 +00:00
parent a4d3da988a
commit 429b3a5dae
1 changed files with 3 additions and 2 deletions

View File

@ -812,12 +812,13 @@ class Query < ActiveRecord::Base
s = []
if from
if from.is_a?(Date)
from = Time.local(from.year, from.month, from.day).beginning_of_day
from = Time.local(from.year, from.month, from.day).yesterday.end_of_day
else
from = from - 1 # second
end
if self.class.default_timezone == :utc
from = from.utc
end
from = from - 1
s << ("#{table}.#{field} > '%s'" % [connection.quoted_date(from)])
end
if to