Sha256: 70a053affe6e65643cbbf7b6485878b975f76cf30ec493c86134e29149a10113

Contents?: true

Size: 510 Bytes

Versions: 4

Compression:

Stored size: 510 Bytes

Contents

module Kanaui
  class EngineController < ApplicationController

    layout :get_layout

    def get_layout
      layout ||= Kanaui.config[:layout]
    end

    def current_tenant_user
      # If the rails application on which that engine is mounted defines such method (Devise), we extract the current user,
      # if not we default to nil, and serve our static mock configuration
      user = current_user if respond_to?(:current_user)
      Kanaui.current_tenant_user.call(session, user)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kanaui-0.5.0 app/controllers/kanaui/engine_controller.rb
kanaui-0.4.2 app/controllers/kanaui/engine_controller.rb
kanaui-0.4.1 app/controllers/kanaui/engine_controller.rb
kanaui-0.4.0 app/controllers/kanaui/engine_controller.rb