lib/runcible/extensions/consumer.rb in runcible-0.1.4 vs lib/runcible/extensions/consumer.rb in runcible-0.2

- old
+ new

@@ -26,19 +26,19 @@ module Extensions class Consumer < Runcible::Resources::Consumer def self.bind_all(id, repo_id) # bind the consumer to all repositories with the given repo_id - Runcible::Extensions::Repository.retrieve_with_details(repo_id)['distributors'].each do |d| + Runcible::Extensions::Repository.retrieve_with_details(repo_id)['distributors'].collect do |d| self.bind(id, repo_id, d['id']) - end + end.flatten end def self.unbind_all(id, repo_id) # unbind the consumer from all repositories with the given repo_id - Runcible::Extensions::Repository.retrieve_with_details(repo_id)['distributors'].each do |d| + Runcible::Extensions::Repository.retrieve_with_details(repo_id)['distributors'].collect do |d| self.unbind(id, repo_id, d['id']) - end + end.flatten end def self.install_content(id, type_id, units) self.install_units(id, generate_content(type_id, units)) end