leo-clubs/marozi — pull request #61 by leifg (2013-06-05 18:53:13+00:00)
Title: Fix Import for newer XML

Currently the following error is thrown, when the XML file of 2013/2014 is imported:

Creating MD Committees
Error occured: (message: undefined method `member_id' for nil:NilClass)
Backtrace:
/Users/leifg/projects/marozi/app/models/multiple_district.rb:36:in `block in create_committees'
/Users/leifg/projects/marozi/app/models/multiple_district.rb:31:in `each'
/Users/leifg/projects/marozi/app/models/multiple_district.rb:31:in `create_committees'
/Users/leifg/projects/marozi/lib/tasks/import.rake:28:in `block (3 levels) in '
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.5.9/lib/nokogiri/xml/node_set.rb:239:in `block in each'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.5.9/lib/nokogiri/xml/node_set.rb:238:in `upto'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.5.9/lib/nokogiri/xml/node_set.rb:238:in `each'
/Users/leifg/projects/marozi/lib/tasks/import.rake:19:in `each_with_index'
/Users/leifg/projects/marozi/lib/tasks/import.rake:19:in `block (2 levels) in '
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/leifg/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/bin/rake:33:in `'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/Users/leifg/projects/marozi/vendor/bundle/ruby/2.0.0/bin/rake:23:in `

'