Module: RightsService
- Extended by:
- Deprecation
- Defined in:
- app/services/rights_service.rb
Class Method Summary collapse
- .active?(id) ⇒ Boolean
- .active_elements ⇒ Object
- .label(id) ⇒ Object
- .select_active_options ⇒ Object
- .select_all_options ⇒ Object
Class Method Details
.active?(id) ⇒ Boolean
22 23 24 |
# File 'app/services/rights_service.rb', line 22 def self.active?(id) .find(id).fetch('active') end |
.active_elements ⇒ Object
30 31 32 |
# File 'app/services/rights_service.rb', line 30 def self.active_elements .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) .find(id).fetch('term') end |
.select_active_options ⇒ Object
18 19 20 |
# File 'app/services/rights_service.rb', line 18 def self. active_elements.map { |e| [e[:label], e[:id]] } end |
.select_all_options ⇒ Object
11 12 13 14 15 16 |
# File 'app/services/rights_service.rb', line 11 def self. Deprecation.warn(RightsService, "RightsService is deprecated. Use CurationConcerns.config.license_service_class instead. This will be removed in curation_concerns 2.0") .all.map do |element| [element[:label], element[:id]] end end |