]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/concerns/geo_record.rb
Don't include stack backtraces on xml errors when importing traces
[rails.git] / app / models / concerns / geo_record.rb
index 447ee19df61050e83f229619db8968351498a62a..bd96e0ff33261630e848d65a20926c8b7857a233 100644 (file)
@@ -5,16 +5,12 @@ module GeoRecord
   # and not e.g. 4.0e-05
   # Unfortunately you can't extend Numeric classes directly (e.g. `Coord < Float`).
   class Coord < DelegateClass(Float)
-    def initialize(obj)
-      super(obj)
-    end
-
     def to_s
-      format("%.7f", self)
+      format("%<coord>.7f", :coord => self)
     end
 
-    def as_json(_)
-      format("%.7f", self).to_f
+    def as_json(*)
+      format("%<coord>.7f", :coord => self).to_f
     end
   end