Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mark-cooper/c77571e6438779af5fa6 to your computer and use it in GitHub Desktop.
Save mark-cooper/c77571e6438779af5fa6 to your computer and use it in GitHub Desktop.
More extent types ...
require_relative 'utils'
Sequel.migration do
up do
$stderr.puts("Adding more types to the list of extent_extent_type enum values")
enum = self[:enumeration].filter(:name => 'extent_extent_type').select(:id)
# additional DACS recommended extent types
[ "albums", "boxes", "folders", "items", "maps", "posters", "scrapbooks" ].each do |type|
value = self[:enumeration_value].filter(:value => type).select(:id)
if value.count == 0
self[:enumeration_value].insert(:enumeration_id => enum, :value => type, :readonly => 0)
end
end
end
end
# AND ADD TO common/locales/enums/en.yml extent_extent_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment