Fixed bug for retrieving user_group without any users #11

Open
wants to merge 3 commits into
from

Conversation

Projects
None yet
1 participant

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:inbuild'
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

'

Fixed bug when retrieving a user group without any users
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 `<main>'

@yves-vogl yves-vogl closed this Mar 31, 2013

@yves-vogl yves-vogl reopened this Mar 31, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment