Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled by default except on development #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ All you have to do is install it into your Rails 2 or 3 project.
Right now if you use bundler, simply add this to your Gemfile:

# Gemfile
gem "query_reviewer", :git => "git://github.com/nesquena/query_reviewer.git"
gem "query_reviewer"

If you are not using bundler, you might want to [start using it](http://gembundler.com/rails23.html). You can also install this as a plugin:

script/plugin install git://github.com/nesquena/query_reviewer.git
script/plugin install git://github.com/dsboulder/query_reviewer.git

In Rails 2, the rake tasks are not loaded automatically (as a gem), you’ll need to add the following to your Rakefile:

Expand All @@ -59,9 +59,9 @@ If you don't create a config file, the gem will use the default in `vendor/plugi

## Configuration ##

The configuration file allows you to set configuration parameters shared across all rails environment, as well as overriding those shared parameteres with environment-specific parameters (such as disabling analysis on production!)
The configuration file allows you to set configuration parameters shared across all rails environment, as well as overriding those shared parameteres with environment-specific parameters.

* `enabled`: whether any output or query analysis is performed. Set this false in production!
* `enabled`: whether any output or query analysis is performed. By default, it's disabled for all environments except development.
* `inject_view`: controls whether the output automatically is injected before the </body> in HTML output.
* `profiling`: when enabled, runs the MySQL SET PROFILING=1 for queries longer than the `warn_duration_threshold` / 2.0
* `production_data`: whether the duration of a query should be taken into account
Expand Down
2 changes: 1 addition & 1 deletion lib/query_reviewer/views/_box_disabled.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<p>SQL analysis has been disabled for you. A cookie must be set to enable analysis. This generally slows down your browser, so it's only recommended for users analyzing SQL queries.</p>
<p id="query_review_enable_link"><b><a href="javascript: createCookie('query_review_enabled', '1'); query_review_hide('query_review_enable_link'); alert('Cookie successfully set.');">Enabled it</a> on next page load and from now on.</b></p>
<p id="query_review_enable_link"><b><a href="javascript: createCookie('query_review_enabled', '1'); query_review_hide('query_review_enable_link'); alert('Cookie successfully set.');">Enable it</a> on next page load and from now on.</b></p>
9 changes: 2 additions & 7 deletions query_reviewer_defaults.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
all:
enabled: false
inject_view: true
stack_trace_lines: 3
trace_includes_vendor: false
trace_includes_lib: true
profiling: enabled
production_data: true
max_safe_key_length: 100
disable_sql_cache: true
disable_sql_cache: true

warn_severity: 3
critical_severity: 7
Expand All @@ -31,9 +32,3 @@ all:

development:
enabled: true

production:
enabled: false

test:
enabled: false