On 02/18, David Lutterkort wrote: > On Mon, 2013-02-18 at 14:41 +0100, mfoj...@redhat.com wrote: > > From: Michal Fojtik <mfoj...@redhat.com> > > > > So instead of writing: > > > > instances = filter_on instances, :id, opts > > instances = filter_on instances, :realm_id, opts > > instances = filter_on instances, :state, opts > > > > You can now use: > > > > instances = filter_on instances, opts, :id, :realm_id, :state > > > > The backward compatibility with old filter_on included. > > > > Signed-off-by: Michal fojtik <mfoj...@redhat.com> > > NAK. I like the idea, but it has a couple flaws: > > * instead of doing gymnastics to support the old and the new > filter_on gymnastics, why not introduce a new filter method that > cab do something like filter(coll, :id => [42, 43], :name => > ['A', 'B'], :state => "RUNNING") IOW, use the keys of the > passed-in hash to determine which fields to filter on ? > filter_on could then just be a simple frontend to the new filter > method
Agree, definitely a better approach :-) I'll push the rest of this set and send out next revision of this patch :) -- Michal -- Michal Fojtik <mfoj...@redhat.com> Deltacloud API, CloudForms