Module: RightsService

Extended by:
Deprecation
Defined in:
app/services/rights_service.rb

Class Method Summary collapse

Class Method Details

.active?(id) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/services/rights_service.rb', line 22

def self.active?(id)
  authority.find(id).fetch('active')
end

.active_elementsObject



30
31
32
# File 'app/services/rights_service.rb', line 30

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

.label(id) ⇒ Object



26
27
28
# File 'app/services/rights_service.rb', line 26

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

.select_active_optionsObject



18
19
20
# File 'app/services/rights_service.rb', line 18

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

.select_all_optionsObject



11
12
13
14
15
16
# File 'app/services/rights_service.rb', line 11

def self.select_all_options
  Deprecation.warn(RightsService, "RightsService is deprecated. Use CurationConcerns.config.license_service_class instead. This will be removed in curation_concerns 2.0")
  authority.all.map do |element|
    [element[:label], element[:id]]
  end
end