Origin UI 190 - Expose region for app create and show

@fabianofranz please review
Added a test previously at suggestion of @fabianofranz to handle empty and nil gear_groups

----- Original Message -----
From: "Jordan Liggitt" <notifications@github.com>
To: "openshift/origin-server" <origin-server@noreply.github.com>
Cc: "Jeff Cantrill" <jcantril@redhat.com>
Sent: Tuesday, July 22, 2014 2:05:52 PM
Subject: Re: [origin-server] Origin UI 190 - Expose region for app create and show (#5633)

> @@ -1,5 +1,26 @@
>  module Console::ModelHelper
>  
> +  ##
> +  # Retrieve the assigned region from a list of GearGroups
> +  # and format for display
> +  #
> +  # @param  (Array)  gear_groups   A list of gear groups
> +  # @return (String)               Formatted region or nil
> +  def assigned_region(gear_groups)
> +    gear_groups.first.gears.first.region.humanize unless gear_groups.blank?

Make this more resilient to a missing region (region can be nil from the API), and maybe check to make sure we have a gears.first isn't nil

---
Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin-server/pull/5633/files#r15244961