Created
January 15, 2016 18:08
-
-
Save miyamae/5a3e62a8606756f0f5f0 to your computer and use it in GitHub Desktop.
gem apartmentを使った時のRails.cacheの追加設定
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
# テナント間でキャッシュキーが同じになってしまいデータが混線するのを防ぐため | |
# config/initializersでnamespaceの設定を追加します。 | |
Rails.cache.options[:namespace] = proc { "#{Apartment::Tenant.current}-#{I18n.locale}" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment