Sha256: 87a4dab9c028bf787bab35c253c4f774b48a6b9d3174a96b310734b4eda04bb1

Contents?: true

Size: 558 Bytes

Versions: 14

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

class Subject < ApplicationRecord
  include Accession::Principal

  has_many :subject_roles, dependent: :destroy
  has_many :roles, through: :subject_roles, dependent: :destroy

  valhammer

  def permissions
    # This could be extended to gather permissions from
    # other data sources providing input to subject identity
    roles.joins(:permissions).pluck('permissions.value')
  end

  def functioning?
    # more than enabled? could inform functioning?
    # such as an administrative or AAF lock
    enabled?
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
aaf-gumboot-2.6.3 spec/dummy/app/models/subject.rb
aaf-gumboot-2.6.2 spec/dummy/app/models/subject.rb
aaf-gumboot-2.6.1 spec/dummy/app/models/subject.rb
aaf-gumboot-2.6.0 spec/dummy/app/models/subject.rb
aaf-gumboot-2.5.1 spec/dummy/app/models/subject.rb
aaf-gumboot-2.5.0 spec/dummy/app/models/subject.rb
aaf-gumboot-2.4.0 spec/dummy/app/models/subject.rb
aaf-gumboot-2.2.0 spec/dummy/app/models/subject.rb
aaf-gumboot-2.1.4 spec/dummy/app/models/subject.rb
aaf-gumboot-2.1.3 spec/dummy/app/models/subject.rb
aaf-gumboot-2.1.1 spec/dummy/app/models/subject.rb
aaf-gumboot-2.1.0 spec/dummy/app/models/subject.rb
aaf-gumboot-2.0.1 spec/dummy/app/models/subject.rb
aaf-gumboot-1.2.0 spec/dummy/app/models/subject.rb