-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show a warning when trying to set
Makara::Cache.store
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,20 @@ | ||
module Makara | ||
module Cache | ||
|
||
class << self | ||
|
||
def store=(store) | ||
Logging::Logger.log deprecation_warning, :warn | ||
end | ||
|
||
private | ||
|
||
def deprecation_warning | ||
<<~WARN | ||
Makara's context is no longer persisted in a backend cache, a cookie store is used by default. | ||
Setting the Makara::Cache.store won't have any effects. | ||
WARN | ||
end | ||
end | ||
end | ||
end |
This file contains 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,9 @@ | ||
require 'spec_helper' | ||
|
||
describe Makara::Cache do | ||
|
||
it 'shows a warning' do | ||
expect(Makara::Logging::Logger).to receive(:log).with(/Setting the Makara::Cache\.store won't have any effects/, :warn) | ||
described_class.store = :noop | ||
end | ||
end |