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

[Fix #495] Default rails console strategy configuration #780

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

### Changes

* [#778](https://github.com/toptal/chewy/pull/778): **(Breaking)** Drop support for Ruby 2.5 ([@Vitalina-Vakulchyk][]):
* [#780](https://github.com/toptal/chewy/pull/780): Changing default console strategy ([@Vitalina-Vakulchyk][]):
* ability to set default console strategy with `Chewy.console_strategy`
* `:urgent` is used by default if `Chewy.console_strategy` is not set
* [#778](https://github.com/toptal/chewy/pull/778): **(Breaking)** Drop support for Ruby 2.5 ([@Vitalina-Vakulchyk][])
* [#776](https://github.com/toptal/chewy/pull/776): **(Breaking)** Removal of unnecessary features and integrations ([@Vitalina-Vakulchyk][]):
* `aws-sdk-sqs` / `shoryuken`
* `mongoid`
Expand Down
4 changes: 4 additions & 0 deletions lib/chewy/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class Config
# for more info.
#
:request_strategy,
# Default console strategy.
# `:urgent` is used by default if `console_strategy` is not set.
#
:console_strategy,
# Use after_commit callbacks for RDBMS instead of
# after_save and after_destroy. True by default. Useful
# in tests with transactional fixtures or transactional
Expand Down
3 changes: 2 additions & 1 deletion lib/chewy/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def migrate(*args)
if app.sandbox?
Chewy.strategy(:bypass)
else
Chewy.strategy(:urgent)
strategy = Chewy.console_strategy || :urgent
Chewy.strategy(strategy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end
puts "Chewy console strategy is `#{Chewy.strategy.current.name}`"
end
Expand Down