Skip to content

Commit

Permalink
fix weirdness with profile coming back as an empty array instead of a…
Browse files Browse the repository at this point in the history
…n empty hash when no profile exsts
  • Loading branch information
Dhruv Bansal committed Aug 13, 2012
1 parent 0fe2a12 commit 1c3bd59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/rubix/models/host.rb
Expand Up @@ -175,6 +175,7 @@ def before_destroy

def self.build host
host['profile'].delete('hostid') if host.is_a?(Hash) && host['profile'].is_a?(Hash) && host['profile']['hostid']
host.delete('profile') if host.is_a?(Hash) && host['profile'].is_a?(Array)
new({
:id => host[id_field].to_i,
:name => host['host'],
Expand Down

0 comments on commit 1c3bd59

Please sign in to comment.