X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/898beb7b7f693cc21b329dab9a22268e3df77446..231bdf66cdc8239c37e1536be4fb52ce275219e3:/app/controllers/changeset_controller.rb?ds=sidebyside diff --git a/app/controllers/changeset_controller.rb b/app/controllers/changeset_controller.rb index 8f882e80e..b2ff42711 100644 --- a/app/controllers/changeset_controller.rb +++ b/app/controllers/changeset_controller.rb @@ -376,11 +376,11 @@ private times = time.split(/,/) raise OSM::APIBadUserInput.new("bad time range") if times.size != 2 - from, to = times.collect { |t| Time.parse(t) } + from, to = times.collect { |t| DateTime.parse(t) } return ['closed_at >= ? and created_at <= ?', from, to] else # if there is no comma, assume its a lower limit on time - return ['closed_at >= ?', Time.parse(time)] + return ['closed_at >= ?', DateTime.parse(time)] end else return nil @@ -395,8 +395,14 @@ private ## # restrict changes to those which are open + # + # at the moment this code assumes we're only interested in open + # changesets and gives no facility to query closed changesets. this + # would be reasonably simple to implement if anyone actually wants + # it? def conditions_open(open) - return open.nil? ? nil : ['closed_at >= ?', Time.now] + return open.nil? ? nil : ['closed_at >= ? and num_changes <= ?', + DateTime.now, Changeset::MAX_ELEMENTS] end end