Permalink
Browse files

fix weirdness with profile coming back as an empty array instead of a…

…n empty hash when no profile exsts
  • Loading branch information...
1 parent 0fe2a12 commit 1c3bd59780d66281fc600634ce7c2965165982fb Dhruv Bansal committed Aug 13, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/rubix/models/host.rb
View
@@ -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'],

0 comments on commit 1c3bd59

Please sign in to comment.