[PATCH aeolus-conductor] BZ#789102 Default to first catalog of deployable if catalog not set

mtaylor at redhat.com mtaylor at redhat.com
Fri Feb 10 18:20:07 UTC 2012


From: Martyn Taylor <mtaylor at redhat.com>

---
 src/app/controllers/deployables_controller.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb
index cf5c6b0..4e4404f 100644
--- a/src/app/controllers/deployables_controller.rb
+++ b/src/app/controllers/deployables_controller.rb
@@ -59,7 +59,7 @@ class DeployablesController < ApplicationController
 
   def show
     @deployable = Deployable.find(params[:id])
-    @catalog = Catalog.find(params[:catalog_id]) if params[:catalog_id].present?
+    @catalog = params[:catalog_id].present? ? Catalog.find(params[:catalog_id]) : @deployable.catalogs.first
     require_privilege(Privilege::VIEW, @deployable)
     save_breadcrumb(polymorphic_path([@catalog, @deployable]), @deployable.name)
     @providers = Provider.all
-- 
1.7.6.4




More information about the aeolus-devel mailing list