query_reviewer 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,8 +48,7 @@ module QueryReviewer
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def perform_action_with_query_review(*args)
|
51
|
-
|
52
|
-
(CONFIGURATION["enabled"] == "based_on_session" and session["query_review_enabled"])
|
51
|
+
Thread.current["query_reviewer_enabled"] = query_reviewer_output_enabled?
|
53
52
|
|
54
53
|
t1 = Time.now
|
55
54
|
r = defined?(Rails::Railtie) ? process_action_without_query_review(*args) : perform_action_without_query_review(*args)
|
@@ -63,5 +62,12 @@ module QueryReviewer
|
|
63
62
|
Thread.current["queries"] = SqlQueryCollection.new
|
64
63
|
process_without_query_review(*args)
|
65
64
|
end
|
65
|
+
|
66
|
+
# @return [Boolean]. Returns whether or not the user has indicated that query_reviewer output is enabled
|
67
|
+
def query_reviewer_output_enabled?
|
68
|
+
cookie_enabled = (CONFIGURATION["enabled"] == true and cookies["query_review_enabled"])
|
69
|
+
session_enabled = (CONFIGURATION["enabled"] == "based_on_session" and session["query_review_enabled"])
|
70
|
+
return cookie_enabled || session_enabled
|
71
|
+
end
|
66
72
|
end
|
67
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: query_reviewer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Runs explain before each select query and displays results in an overlayed
|
15
15
|
div
|