Use num_changes to detect empty changesets instead of the bbox
This commit is contained in:
parent
ea207f51cc
commit
e5c80c80ad
3 changed files with 4 additions and 2 deletions
|
@ -446,7 +446,7 @@ private
|
||||||
# eliminate empty changesets (where the bbox has not been set)
|
# eliminate empty changesets (where the bbox has not been set)
|
||||||
# this should be applied to all changeset list displays
|
# this should be applied to all changeset list displays
|
||||||
def conditions_nonempty()
|
def conditions_nonempty()
|
||||||
return ['min_lat IS NOT NULL']
|
return ['num_changes > 0']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
var bounds = new OpenLayers.Bounds();
|
var bounds = new OpenLayers.Bounds();
|
||||||
|
|
||||||
<% @edits.each do |edit| %>
|
<% @edits.each do |edit| %>
|
||||||
|
<% if edit.has_valid_bbox? %>
|
||||||
var minlon = <%= edit.min_lon / GeoRecord::SCALE.to_f %>;
|
var minlon = <%= edit.min_lon / GeoRecord::SCALE.to_f %>;
|
||||||
var minlat = <%= edit.min_lat / GeoRecord::SCALE.to_f %>;
|
var minlat = <%= edit.min_lat / GeoRecord::SCALE.to_f %>;
|
||||||
var maxlon = <%= edit.max_lon / GeoRecord::SCALE.to_f %>;
|
var maxlon = <%= edit.max_lon / GeoRecord::SCALE.to_f %>;
|
||||||
|
@ -60,6 +61,7 @@
|
||||||
|
|
||||||
addBoxToMap(bbox, "<%= edit.id %>", true);
|
addBoxToMap(bbox, "<%= edit.id %>", true);
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
vectors.events.on({
|
vectors.events.on({
|
||||||
"featureselected": function(feature) {
|
"featureselected": function(feature) {
|
||||||
|
|
|
@ -1643,7 +1643,7 @@ EOF
|
||||||
##
|
##
|
||||||
# This should display the last 20 changesets closed.
|
# This should display the last 20 changesets closed.
|
||||||
def test_list
|
def test_list
|
||||||
changesets = Changeset.find(:all, :order => "created_at DESC", :conditions => ['min_lat IS NOT NULL'], :limit=> 20)
|
changesets = Changeset.find(:all, :order => "created_at DESC", :conditions => ['num_changes > 0'], :limit=> 20)
|
||||||
assert changesets.size <= 20
|
assert changesets.size <= 20
|
||||||
get :list, {:format => "html"}
|
get :list, {:format => "html"}
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
Loading…
Add table
Reference in a new issue