Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-08 18:10:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-08 18:10:26 +0300
commit9f9dc2bc412632e6b459d0bb9e1ac205c8cf34af (patch)
treecaafa909017726a087ae4e4bdaeb558ac2c04a9b /app/services/audit_event_service.rb
parent88bacc889f129f8d95af34f1781dd66769ec27cc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/audit_event_service.rb')
-rw-r--r--app/services/audit_event_service.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/services/audit_event_service.rb b/app/services/audit_event_service.rb
index ad733c455a9..97debccfb18 100644
--- a/app/services/audit_event_service.rb
+++ b/app/services/audit_event_service.rb
@@ -14,14 +14,16 @@ class AuditEventService
# @param [Hash] details extra data of audit event
# @param [Symbol] save_type the type to save the event
# Can be selected from the following, :database, :stream, :database_and_stream .
+ # @params [DateTime] created_at the time the action occured
#
# @return [AuditEventService]
- def initialize(author, entity, details = {}, save_type = :database_and_stream)
+ def initialize(author, entity, details = {}, save_type = :database_and_stream, created_at = DateTime.current)
@author = build_author(author)
@entity = entity
@details = details
@ip_address = resolve_ip_address(@author)
@save_type = save_type
+ @created_at = created_at
end
# Builds the @details attribute for authentication
@@ -79,7 +81,8 @@ class AuditEventService
author_id: @author.id,
author_name: @author.name,
entity_id: @entity.id,
- entity_type: @entity.class.name
+ entity_type: @entity.class.name,
+ created_at: @created_at
}
end