]> git.openstreetmap.org Git - rails.git/blobdiff - lib/quad_tile.rb
Add "blocks on" and "blocks by" links to the user page when a logged
[rails.git] / lib / quad_tile.rb
index cb1b5a06e1ee7886ce4ce23e7a8019ee399f9e11..6e4fb6d2248c243bfc15c245fa0e643501229abf 100644 (file)
@@ -41,7 +41,7 @@ module QuadTile
     end
   end
 
-  def self.sql_for_area(minlat, minlon, maxlat, maxlon)
+  def self.sql_for_area(minlat, minlon, maxlat, maxlon, prefix)
     sql = Array.new
     single = Array.new
 
@@ -49,11 +49,11 @@ module QuadTile
       if first == last
         single.push(first)
       else
-        sql.push("tile BETWEEN #{first} AND #{last}")
+        sql.push("#{prefix}tile BETWEEN #{first} AND #{last}")
       end
     end
 
-    sql.push("tile IN (#{single.join(',')})") if single.size > 0
+    sql.push("#{prefix}tile IN (#{single.join(',')})") if single.size > 0
 
     return "( " + sql.join(" OR ") + " )"
   end