Skip to content

Commit

Permalink
Refactor bbox() function's ActiveRecord query to new Rails syntax pub…
Browse files Browse the repository at this point in the history
  • Loading branch information
labseven committed Mar 21, 2019
1 parent f4650a7 commit 58b54e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def anonymous?
self.author == "" || self.user_id == 0
end

def self.bbox(minlat,minlon,maxlat,maxlon)
Map.find :all, :conditions => ['lat > ? AND lat < ? AND lon > ? AND lon < ?',minlat,maxlat,minlon,maxlon]
def self.bbox(minlat, minlon, maxlat, maxlon)
Map.where(['lat > ? AND lat < ? AND lon > ? AND lon < ?', minlat, maxlat, minlon, maxlon])
end

def exporting?
Expand Down Expand Up @@ -210,7 +210,7 @@ def run_export(user, resolution)
:map_id => id
})
end
Exporter.run_export(user,
Exporter.run_export(user,
resolution,
self.export,
self.id,
Expand Down

0 comments on commit 58b54e2

Please sign in to comment.