ServerStatusObject.new fails

To replicate use the latest master.


pjh239-maclap:mongo-tools phalliday$ bundle exec rails c
Loading development environment (Rails 3.2.13)
1.9.3p392 :001 > ServerStatusObject.new
NoMethodError: undefined method `collection' for nil:NilClass
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/persistence.rb:49:in `collection'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/persistence.rb:61:in `collection'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/querying.rb:161:in `save_to_collection'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/associations.rb:82:in `save_to_collection'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/safe.rb:24:in `save_to_collection'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/querying.rb:156:in `update'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/callbacks.rb:25:in `block in update'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:403:in `_run__3275299075161848839__update__4376346238033922911__callbacks'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_update_callbacks'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/embedded_callbacks.rb:28:in `run_callbacks'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/embedded_callbacks.rb:23:in `block (2 levels) in run_callbacks'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:403:in `_run__1556225508124245583__update__4376346238033922911__callbacks'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_update_callbacks'
... 39 levels...
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/embedded_callbacks.rb:28:in `run_callbacks'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/callbacks.rb:17:in `create_or_update'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/querying.rb:129:in `save'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/dirty.rb:19:in `block in save'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/dirty.rb:37:in `clear_changes'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/dirty.rb:19:in `save'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/validations.rb:22:in `save'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/identity_map.rb:113:in `save'
	from /Users/phalliday/mongo-tools/app/models/server_status_object.rb:24:in `initialize'
	from (irb):1:in `new'
	from (irb):1
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
	from /Users/phalliday/.rvm/gems/ruby-1.9.3-p392@mongo-tools/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
	from script/rails:6:in `require'
	from script/rails:6:in `<main>'1.9.3p392 :002 >