From: Tom Hughes Date: Sun, 16 Aug 2009 10:36:16 +0000 (+0000) Subject: Qualify SCALE properly - apparently object visibility when running the X-Git-Tag: live~6706 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/0f6dda6050204cba832bbe290a16181cbca0a77f?hp=-c Qualify SCALE properly - apparently object visibility when running the test suite is not the same as when running live... Rails FAIL! --- 0f6dda6050204cba832bbe290a16181cbca0a77f diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 498df5b82..4efd4f9e7 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -112,10 +112,10 @@ class Changeset < ActiveRecord::Base # FIXME - this looks nasty and violates DRY... is there any prettier # way to do this? - @bbox[0] = [-180 * SCALE, array[0] + EXPAND * (@bbox[0] - @bbox[2])].max if array[0] < @bbox[0] - @bbox[1] = [ -90 * SCALE, array[1] + EXPAND * (@bbox[1] - @bbox[3])].max if array[1] < @bbox[1] - @bbox[2] = [ 180 * SCALE, array[2] + EXPAND * (@bbox[2] - @bbox[0])].min if array[2] > @bbox[2] - @bbox[3] = [ 90 * SCALE, array[3] + EXPAND * (@bbox[3] - @bbox[1])].min if array[3] > @bbox[3] + @bbox[0] = [-180 * GeoRecord::SCALE, array[0] + EXPAND * (@bbox[0] - @bbox[2])].max if array[0] < @bbox[0] + @bbox[1] = [ -90 * GeoRecord::SCALE, array[1] + EXPAND * (@bbox[1] - @bbox[3])].max if array[1] < @bbox[1] + @bbox[2] = [ 180 * GeoRecord::SCALE, array[2] + EXPAND * (@bbox[2] - @bbox[0])].min if array[2] > @bbox[2] + @bbox[3] = [ 90 * GeoRecord::SCALE, array[3] + EXPAND * (@bbox[3] - @bbox[1])].min if array[3] > @bbox[3] # update active record. rails 2.1's dirty handling should take care of # whether this object needs saving or not.