Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug for retrieving user_group without any users #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fixed bug for retrieving user_group without any users #11

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 31, 2013

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

'

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>'
@ghost ghost closed this Mar 31, 2013
@ghost ghost reopened this Mar 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant