Module: DomainAware

Extended by:
ActiveSupport::Concern
Included in:
Account::Dashboard, ConsoleController
Defined in:
app/controllers/domain_aware.rb

Instance Method Summary collapse

Instance Method Details

#domain_is_missingObject



21
22
23
# File 'app/controllers/domain_aware.rb', line 21

def domain_is_missing
  session.delete :domain
end

#user_default_domainObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/domain_aware.rb', line 8

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