Skip to content

Hyrax: Get a list of available Work Types

Paul Danelli edited this page Feb 24, 2022 · 1 revision

From time to time you will need to check all of the available work types. Each site has a list of enabled work types, but there is also a list of work types that have been registered and are available to the sites.

To get a list of all work types, irrespective of the site:

Hyrax.config.registered_curation_concern_types

To get the work types that are available to your current site instance:

account = Account.first # Or your account
AccountElevator.switch! account.cname

Site.instance.available_works

Both of these methods will return a list of class names as strings:

["Article", "Book", "GenericWork", "Image"]