]> git.openstreetmap.org Git - rails.git/blobdiff - lib/osm.rb
sort the default test database user and password.
[rails.git] / lib / osm.rb
index 8798866e5dc918ab5fc63d94bbf217924cc5effd..c038ab2d5f77464833d8c6c3d3a5f24b5184d5a1 100644 (file)
@@ -10,7 +10,9 @@ module OSM
 
   # The base class for API Errors.
   class APIError < RuntimeError
-    def render_opts { :text => "", :status => :internal_server_error } end
+    def render_opts
+      { :text => "", :status => :internal_server_error }
+    end
   end
 
   # Raised when an API object is not found.
@@ -19,12 +21,16 @@ module OSM
 
   # Raised when a precondition to an API action fails sanity check.
   class APIPreconditionFailedError < APIError
-    def render_opts { :text => "", :status => :precondition_failed } end
+    def render_opts
+      { :text => "", :status => :precondition_failed }
+    end
   end
 
   # Raised when to delete an already-deleted object.
   class APIAlreadyDeletedError < APIError
-    def render_opts { :text => "", :status => :gone } end
+    def render_opts
+      { :text => "", :status => :gone }
+    end
   end
 
   # Raised when the provided version is not equal to the latest in the db.
@@ -36,8 +42,8 @@ module OSM
     attr_reader :provided, :latest
 
     def render_opts
-      { :text => "Version mismatch: Provided " + ex.provided.to_s +
-       ", server had: " + ex.latest.to_s, :status => :bad_request }
+      { :text => "Version mismatch: Provided " + provided.to_s +
+       ", server had: " + latest.to_s, :status => :bad_request }
     end
   end