Created
May 14, 2014 23:41
-
-
Save mark-cooper/c77571e6438779af5fa6 to your computer and use it in GitHub Desktop.
More extent types ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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