Sha256: f677726b12135ea6286c36a333cf77ddc4ecf5f7b8586578f1d5003dd2ffca5c
Contents?: true
Size: 596 Bytes
Versions: 3
Compression:
Stored size: 596 Bytes
Contents
module DomainAware extend ActiveSupport::Concern included do around_filter DomainSessionSweeper end def user_default_domain @domain ||= begin if name = session[:domain] logger.debug " Using cached domain #{name}" Domain.new({:id => name, :as => current_user}, true) else Domain.find(:one, :as => current_user).tap do |domain| session[:domain] = domain.id end end end end def domain_is_missing session.delete :domain end end RestApi::Base.observers << DomainSessionSweeper DomainSessionSweeper.instance
Version data entries
3 entries across 3 versions & 1 rubygems