Permalink
Browse files

debugging RqlQuery middleware

  • Loading branch information...
1 parent 7879aab commit 90077e10464b8ab5aaac344540ff41f90f44e527 @rheimbuch committed Apr 18, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/rack/rql.rb
View
@@ -1,4 +1,5 @@
require 'rql'
+require 'rack/request'
module Rack
class RqlQuery
@@ -7,9 +8,13 @@ def initialize(app, js_runtime=nil)
end
def call(env)
- if !env['rql.query'] && env['QUERY_STRING']
+ req = Rack::Request.new(env)
+ qs = req.query_string
+
+ req.logger(qs)
+ if !env['rql.query'] && qs
begin
- env['rql.query'] = Rql[env['QUERY_STRING']]
+ env['rql.query'] = Rql[qs]
rescue => e
env['rql.error'] = e
end

0 comments on commit 90077e1

Please sign in to comment.