def extract_id(hash)
      passed_id = hash[:id]
      if passed_id.to_i > 0
        passed_id.to_i
      else
        begin
          klass = klass_for_type hash[:type]
          model = klass.find passed_id
          model.id
        rescue
          passed_id
        end
      end
    end
def extract_id(hash)
      passed_id = hash[:id]
      if passed_id.to_i > 0
        passed_id.to_i
      else
        begin
          klass = klass_for_type hash[:type]
          model = klass.find passed_id
          model.id
        rescue
          passed_id
        end
      end
    end
Extracts the numerical ID from a JSONAPI style type / id payload.  If the ID is
 not numerical, it will attempt to resolve the ID to a model by issuing a find
 on it's class (gathered from the type also in the hash).  If it can't find a
 Class or Model of the payload, it will just return the original ID.  Useful when
 using the :finders feature of Friendly ID.

 Params:
 +hash+:: +Hash+ Hash with type/id pair, as per the JSONAPI Spec