make sure api key finders are strings
This commit is contained in:
		@@ -8,7 +8,7 @@ class ApiKeysController < ApplicationController
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def destroy
 | 
			
		||||
    current_user.api_keys.find_by_api_key(params[:id]).try(:destroy)
 | 
			
		||||
    current_user.api_keys.find_by_api_key(params[:id].to_s).try(:destroy)
 | 
			
		||||
    redirect_to :back
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@@ -34,7 +34,7 @@ class ApiKeysController < ApplicationController
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def update
 | 
			
		||||
    @api_key = current_user.api_keys.find_by_api_key(params[:id])
 | 
			
		||||
    @api_key = current_user.api_keys.find_by_api_key(params[:id].to_s)
 | 
			
		||||
    @api_key.update_attributes(api_key_params)
 | 
			
		||||
    redirect_to :back
 | 
			
		||||
  end
 | 
			
		||||
 
 | 
			
		||||
@@ -201,7 +201,7 @@ class ApplicationController < ActionController::Base
 | 
			
		||||
    def get_apikey
 | 
			
		||||
      key = get_header_value(HTTP_HEADER_API_KEY_NAME) || params[:key] || params[:api_key] || params[:apikey]
 | 
			
		||||
      key.strip if key.present?
 | 
			
		||||
      return key
 | 
			
		||||
      return key.to_s
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # get specified header value
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user