On Wed, 2013-01-23 at 16:51 +0100, mfoj...@redhat.com wrote: > From: Michal Fojtik <mfoj...@redhat.com> > > > Signed-off-by: Michal fojtik <mfoj...@redhat.com> > --- > server/lib/cimi/models/collection.rb | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/server/lib/cimi/models/collection.rb > b/server/lib/cimi/models/collection.rb > index 0f2a89e..aafa6a5 100644 > --- a/server/lib/cimi/models/collection.rb > +++ b/server/lib/cimi/models/collection.rb > @@ -24,11 +24,15 @@ module CIMI::Model > self.schema > > def initialize(values = {}) > - if values[:entries] > - values[self.class.entry_name] = values.delete(:entries) > + if values.kind_of?(Hash) > + if values[:entries] > + values[self.class.entry_name] = values.delete(:entries) > + end > + values[self.class.entry_name] ||= [] > + super(values) > + else > + super
It would be good to add a comment what other objects, besides hashes can be passed in here and why. Also, this needs a test that verifies that issue 432 is really fixed. NACK based on the missing test and the problems described in JIRA 432. David