Class: Tramway::Core::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/tramway/core/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#applicationObject



7
8
9
# File 'app/controllers/tramway/core/application_controller.rb', line 7

def application
  @application = ::Tramway::Core.application_object
end

#authenticated_userObject



19
20
21
# File 'app/controllers/tramway/core/application_controller.rb', line 19

def authenticated_user
  (defined?(current_user) && current_user.try(:model)) || (defined?(current_admin) && current_admin.model)
end

#load_extensionsObject



11
12
13
# File 'app/controllers/tramway/core/application_controller.rb', line 11

def load_extensions
  ::Tramway::Extensions.load if defined? ::Tramway::Extensions
end

#model_classObject



15
16
17
# File 'app/controllers/tramway/core/application_controller.rb', line 15

def model_class
  params[:model].constantize
end