Class/Module Index [+]

Quicksearch

OpenShift::Controller::ActionLog

Attributes

action_log_tag[W]

Override the action log tag for a particular action. Should be set as early as possible in the request chain.

Protected Instance Methods

action_log_tag() click to toggle source

The user action log tag for requests made from this controller.

# File lib/openshift/controller/action_log.rb, line 68
def action_log_tag
  @action_log_tag ||= "#{action_log_tag_action}_#{action_log_tag_resource}"
end
action_log_tag_action() click to toggle source

The tag for an action made from this controller method

# File lib/openshift/controller/action_log.rb, line 48
def action_log_tag_action
  case request.method
  when "GET"    then params[:id] ? "SHOW" : "LIST"
  when "POST"   then "ADD" 
  when "PUT"    then "UPDATE"
  when "DELETE" then "DELETE"
  else               "UNKNOWN"
  end
end
action_log_tag_resource() click to toggle source

The resource that is being logged

# File lib/openshift/controller/action_log.rb, line 61
def action_log_tag_resource
  controller_name.singularize.upcase
end
log_action(*arguments) click to toggle source

Log an action for the current user

# File lib/openshift/controller/action_log.rb, line 34
def log_action(*arguments)
  OpenShift::UserActionLog.action(*arguments)
end
log_action_for(login, user_id, *arguments) click to toggle source

Log an action for a user who has not been authenticated yet. Will override any previous call to log_actions_as.

# File lib/openshift/controller/action_log.rb, line 27
def log_action_for(login, user_id, *arguments)
  OpenShift::UserActionLog.with_user(user_id, login)
  OpenShift::UserActionLog.action(*arguments)
end
log_actions_as(user) click to toggle source

Log subsequent actions as the given user

# File lib/openshift/controller/action_log.rb, line 41
def log_actions_as(user)
  OpenShift::UserActionLog.with_user(user.id, user.login)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.