dhruvbansal/rubix — pull request #11 by yves-vogl (2013-03-31 11:15:40+00:00)
Title: Fixed bug for retrieving user_group without any users

Hi,

thanks for your great library! If encountered a bug. When you try to retrieve a user_group with has no users yet, thet map is called on nil an fails.
I fixed this.

1.9.3p194 :013 > user_group = Rubix::HostGroup.find_or_create(:name => 'Customers')
NoMethodError: undefined method `map' for nil:NilClass
from /Users/Yves/.rvm/gems/ruby-1.9.3-p194/gems/rubix-0.5.14/lib/rubix/models/host_group.rb:51:in `build'
from /Users/Yves/.rvm/gems/ruby-1.9.3-p194/gems/rubix-0.5.14/lib/rubix/models/model.rb:383:in `find_or_create'
from (irb):13
from /Users/Yves/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `

'