]> git.openstreetmap.org Git - rails.git/commitdiff
Replace deprecated Mime::XXX with Mime[:xxx]
authorTom Hughes <tom@compton.nu>
Sat, 3 Jun 2017 16:22:01 +0000 (17:22 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 3 Jun 2017 16:33:13 +0000 (17:33 +0100)
app/controllers/amf_controller.rb
app/controllers/trace_controller.rb

index 47a28fd4041fd46a6a0c3eca84be7dff37cfe54d..51db8296df7312f6701236fcb81ce9b94f871380 100644 (file)
@@ -46,7 +46,7 @@ class AmfController < ApplicationController
 
   def amf_read
     self.status = :ok
 
   def amf_read
     self.status = :ok
-    self.content_type = Mime::AMF
+    self.content_type = Mime[:amf]
     self.response_body = Dispatcher.new(request.raw_post) do |message, *args|
       logger.info("Executing AMF #{message}(#{args.join(',')})")
 
     self.response_body = Dispatcher.new(request.raw_post) do |message, *args|
       logger.info("Executing AMF #{message}(#{args.join(',')})")
 
@@ -74,7 +74,7 @@ class AmfController < ApplicationController
     err = false                       # Abort batch on error
 
     self.status = :ok
     err = false                       # Abort batch on error
 
     self.status = :ok
-    self.content_type = Mime::AMF
+    self.content_type = Mime[:amf]
     self.response_body = Dispatcher.new(request.raw_post) do |message, *args|
       logger.info("Executing AMF #{message}")
 
     self.response_body = Dispatcher.new(request.raw_post) do |message, *args|
       logger.info("Executing AMF #{message}")
 
index 6e502fdc67d0588854ffe3b5048dac93aa545716..b6fd2984ab47373b8f457f8cdb0b53a262ce404b 100644 (file)
@@ -146,9 +146,9 @@ class TraceController < ApplicationController
     if trace.visible? && (trace.public? || (@user && @user == trace.user))
       if Acl.no_trace_download(request.remote_ip)
         head :forbidden
     if trace.visible? && (trace.public? || (@user && @user == trace.user))
       if Acl.no_trace_download(request.remote_ip)
         head :forbidden
-      elsif request.format == Mime::XML
+      elsif request.format == Mime[:xml]
         send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => "attachment")
         send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => "attachment")
-      elsif request.format == Mime::GPX
+      elsif request.format == Mime[:gpx]
         send_file(trace.xml_file, :filename => "#{trace.id}.gpx", :type => request.format.to_s, :disposition => "attachment")
       else
         send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => "attachment")
         send_file(trace.xml_file, :filename => "#{trace.id}.gpx", :type => request.format.to_s, :disposition => "attachment")
       else
         send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => "attachment")
@@ -295,9 +295,9 @@ class TraceController < ApplicationController
     trace = Trace.visible.find(params[:id])
 
     if trace.public? || trace.user == @user
     trace = Trace.visible.find(params[:id])
 
     if trace.public? || trace.user == @user
-      if request.format == Mime::XML
+      if request.format == Mime[:xml]
         send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => "attachment")
         send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => "attachment")
-      elsif request.format == Mime::GPX
+      elsif request.format == Mime[:gpx]
         send_file(trace.xml_file, :filename => "#{trace.id}.gpx", :type => request.format.to_s, :disposition => "attachment")
       else
         send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => "attachment")
         send_file(trace.xml_file, :filename => "#{trace.id}.gpx", :type => request.format.to_s, :disposition => "attachment")
       else
         send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => "attachment")