Sha256: cae113fcb6df9d45b1ef2f7b877200cb48330f3cf1ea5834a949e76bedb5fabb

Contents?: true

Size: 371 Bytes

Versions: 5

Compression:

Stored size: 371 Bytes

Contents

module RightsService
  mattr_accessor :authority
  self.authority = Qa::Authorities::Local.subauthority_for('rights')

  def self.select_options
    active_elements.map { |e| [e[:label], e[:id]] }
  end

  def self.label(id)
    authority.find(id).fetch('term')
  end

  def self.active_elements
    authority.all.select { |e| authority.find(e[:id])[:active] }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
curation_concerns-1.0.0.beta4 app/services/rights_service.rb
curation_concerns-1.0.0.beta3 app/services/rights_service.rb
curation_concerns-1.0.0.beta2 app/services/rights_service.rb
curation_concerns-1.0.0.beta1 app/services/rights_service.rb
curation_concerns-0.14.0 app/services/rights_service.rb