Sha256: 61e4ed054113a8e0d8d974b722492cac1f4638f8fe13c2bc3aae3cd69f2a0f00

Contents?: true

Size: 588 Bytes

Versions: 11

Compression:

Stored size: 588 Bytes

Contents

class ApplicationController < ActionController::API
  def current_user
    # DETERMINATOR: This would return a User object in most applications
    # http://guides.rubyonrails.org/action_controller_overview.html#accessing-the-session
    nil
  end

  def guid
    session[:guid] ||= SecureRandom.uuid
  end

  def determinator
    # DETERMINATOR: A memoized instance of the ActorControl helper class
    # which allows simple use throughout the app
    @_determinator ||= Determinator.instance.for_actor(
      id: current_user && current_user.id || nil,
      guid: guid
    )
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
determinator-0.10.0 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.9.1 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.8.0 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.7.0 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.6.2 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.5.0 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.4.0 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.3.0 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.2.0 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.1.1 examples/determinator-rails/app/controllers/application_controller.rb
determinator-0.1.0 examples/determinator-rails/app/controllers/application_controller.rb