]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/changeset_controller.rb
Fixed bug in changeset closing and querying where the number of elements exceeded...
[rails.git] / app / controllers / changeset_controller.rb
index 3e1870b70b139fe5f8b2433df71a8b97b2a25742..b2ff42711db55a59f35056993647417494252be5 100644 (file)
@@ -4,8 +4,7 @@ class ChangesetController < ApplicationController
   layout 'site'
   require 'xml/libxml'
 
-# session :off
-# FIXME is this required?
+  session :off, :except => [:list]
   before_filter :authorize_web, :only => [:list]
   before_filter :authorize, :only => [:create, :update, :delete, :upload, :include, :close]
   before_filter :check_write_availability, :only => [:create, :update, :delete, :upload, :include]
@@ -396,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 >= ?', DateTime.now]
+    return open.nil? ? nil : ['closed_at >= ? and num_changes <= ?', 
+                              DateTime.now, Changeset::MAX_ELEMENTS]
   end
 
 end