Sha256: 540012dc10c8ab5906b7088615dcfd48b61a539a5b30d08869fc92332b014ddc
Contents?: true
Size: 802 Bytes
Versions: 8
Compression:
Stored size: 802 Bytes
Contents
module Audits1984::Session::Iterable extend ActiveSupport::Concern # Loops through all the session commands in order, yielding lists grouped by # its sensitive access record, or its absence def each_batch_of_commands_grouped_by_sensitive_access group = [] current_sensitive_access = nil commands.includes(:sensitive_access).sorted_chronologically.each.with_index do |command, index| current_sensitive_access = command.sensitive_access if index == 0 if index > 0 && command.sensitive_access != current_sensitive_access yield current_sensitive_access, group group = [] current_sensitive_access = command.sensitive_access end group << command end if group.present? yield current_sensitive_access, group end end end
Version data entries
8 entries across 8 versions & 1 rubygems