-require "delegate"
-
module GeoRecord
extend ActiveSupport::Concern
def to_s
format("%.7f", self)
end
+
+ def as_json(_)
+ format("%.7f", self).to_f
+ end
end
# This scaling factor is used to convert between the float lat/lon that is
SCALE = 10000000
included do
- scope :bbox, ->(bbox) { where(OSM.sql_for_area(bbox)) }
+ scope :bbox, ->(bbox) { where(OSM.sql_for_area(bbox, "#{table_name}.")) }
before_save :update_tile
end