Sha256: 297fa363294b40266d26e8a3b32900dfc3e15e93e6cd46fabb28ed54c7f89aaf
Contents?: true
Size: 489 Bytes
Versions: 27
Compression:
Stored size: 489 Bytes
Contents
def update_agent_type agent_types = YAML.load(open('db/fixtures/enju_biblio/agent_types.yml').read) agent_types.each do |line| l = line[1].select!{|k, v| %w(name display_name note).include?(k)} case l["name"] when "person" agent_type = AgentType.where(name: 'Person').first agent_type.update!(l) if agent_type when "corporate_body" agent_type = AgentType.where(name: 'CorporateBody').first agent_type.update!(l) if agent_type end end end
Version data entries
27 entries across 27 versions & 1 rubygems