-require "delegate"
-
module GeoRecord
extend ActiveSupport::Concern
end
def to_s
- format("%.7f", self)
+ format("%<coord>.7f", :coord => self)
+ end
+
+ def as_json(_)
+ format("%<coord>.7f", :coord => self).to_f
end
end
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