lib/grape/middleware/versioner/param.rb in grape-0.2.6 vs lib/grape/middleware/versioner/param.rb in grape-0.3.0
- old
+ new
@@ -28,10 +28,10 @@
def before
paramkey = options[:parameter]
potential_version = request.params[paramkey]
unless potential_version.nil?
- if options[:versions] && !options[:versions].include?(potential_version)
+ if options[:versions] && ! options[:versions].find { |v| v.to_s == potential_version }
throw :error, :status => 404, :message => "404 API Version Not Found", :headers => {'X-Cascade' => 'pass'}
end
env['api.version'] = potential_version
env['rack.request.query_hash'].delete(paramkey)
end