Skip to content

Instantly share code, notes, and snippets.

@miyamae
Created January 15, 2016 18:08
Show Gist options
  • Save miyamae/5a3e62a8606756f0f5f0 to your computer and use it in GitHub Desktop.
Save miyamae/5a3e62a8606756f0f5f0 to your computer and use it in GitHub Desktop.
gem apartmentを使った時のRails.cacheの追加設定
# テナント間でキャッシュキーが同じになってしまいデータが混線するのを防ぐため
# 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