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

Version Path
enju_biblio-0.3.18 lib/tasks/agent_type.rb
enju_biblio-0.3.17 lib/tasks/agent_type.rb
enju_biblio-0.3.16 lib/tasks/agent_type.rb
enju_biblio-0.3.15 lib/tasks/agent_type.rb
enju_biblio-0.3.14 lib/tasks/agent_type.rb
enju_biblio-0.3.13 lib/tasks/agent_type.rb
enju_biblio-0.3.12 lib/tasks/agent_type.rb
enju_biblio-0.3.11 lib/tasks/agent_type.rb
enju_biblio-0.3.10 lib/tasks/agent_type.rb
enju_biblio-0.3.10.rc.3 lib/tasks/agent_type.rb
enju_biblio-0.3.10.rc.2 lib/tasks/agent_type.rb
enju_biblio-0.3.10.rc.1 lib/tasks/agent_type.rb
enju_biblio-0.3.9 lib/tasks/agent_type.rb
enju_biblio-0.4.0.rc.1 lib/tasks/agent_type.rb
enju_biblio-0.3.8 lib/tasks/agent_type.rb
enju_biblio-0.3.7 lib/tasks/agent_type.rb
enju_biblio-0.3.6 lib/tasks/agent_type.rb
enju_biblio-0.4.0.beta.2 lib/tasks/agent_type.rb
enju_biblio-0.4.0.beta.1 lib/tasks/agent_type.rb
enju_biblio-0.3.5 lib/tasks/agent_type.rb