Sha256: 5b2712bdb78c21f2a2a6671a49ae91ebc2fcf6479abbc98aa0f3bd1d88da9f7a

Contents?: true

Size: 495 Bytes

Versions: 7

Compression:

Stored size: 495 Bytes

Contents

module Audits1984::Session::Auditable
  extend ActiveSupport::Concern

  included do
    has_many :audits, dependent: :destroy, class_name: "Audits1984::Audit"

    scope :sensitive, -> { joins(:sensitive_accesses).distinct }
    scope :reviewed, -> { joins(:audits).distinct }
    scope :approved, -> { reviewed.where("audits.status": :approved) }
    scope :flagged, -> { reviewed.where("audits.status": :flagged) }
    scope :pending, -> { where.not(id: reviewed.distinct(false)) }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
audits1984-0.1.7 app/models/audits1984/session/auditable.rb
audits1984-0.1.6 app/models/audits1984/session/auditable.rb
audits1984-0.1.5 app/models/audits1984/session/auditable.rb
audits1984-0.1.4 app/models/audits1984/session/auditable.rb
audits1984-0.1.3 app/models/audits1984/session/auditable.rb
audits1984-0.1.2 app/models/audits1984/session/auditable.rb
audits1984-0.1.1 app/models/audits1984/session/auditable.rb