-
Notifications
You must be signed in to change notification settings - Fork 11
Extend configuration to support disable_during_db_migrate
#34
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
Open
bschrag620
wants to merge
28
commits into
kvokka:master
Choose a base branch
from
bschrag620:disable-during-db-migrate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
704b232
add config option for disable_during_db_migrate
bschrag620 da2eae7
add rake task
bschrag620 f3a7626
add accessor
bschrag620 7b747ab
load rake tasks
bschrag620 8a78a4e
Update README.md
bschrag620 d261ac9
hook into all `db:*` tasks
bschrag620 037920a
support run time disabling
bschrag620 9a60340
typo
bschrag620 220bd6b
update desc
bschrag620 7ab0d57
default to true
bschrag620 f8214ae
update accessor to `disable_for_db_tasks`
bschrag620 0eedded
use new config name
bschrag620 b796e6d
Update README.md
bschrag620 4a99cfe
create enabled_for helper to honor env var
bschrag620 6a710aa
add test
bschrag620 1e33d77
another test
bschrag620 c18f7a8
remove env var lookup in rake task
bschrag620 c44c1b8
typo
bschrag620 f7ad848
correct method name
bschrag620 29dab50
fix it for real this time
bschrag620 ea45172
remove enabled_for? method
bschrag620 b1b6c08
update rake task
bschrag620 1bd0b61
only load tasks if enable_for_rails_db_tasks
bschrag620 ce6fc81
remove tests
bschrag620 fcdedf2
read from env var
bschrag620 9b37fda
readme updates
bschrag620 fbc41b4
use correct accessor name
bschrag620 12bcb2a
update readme
bschrag620 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| namespace :pp_sql do | ||
| desc 'Hook that is ran before rails `db:*` tasks that can disable pp_sql' | ||
|
|
||
| task :disable_during_db_tasks do | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. task :disable_during_db_tasks do
PpSql.add_rails_logger_formatting = false
PpSql.rewrite_to_sql_method = false
end
end |
||
| PpSql.add_rails_logger_formatting = false | ||
| PpSql.rewrite_to_sql_method = false | ||
| end | ||
| end | ||
|
|
||
| db_tasks = Rake::Task.tasks.select { |task| task.name.starts_with?('db:') } | ||
| db_tasks.each { |task| task.enhance(['pp_sql:disable_during_db_tasks']) } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.