[PATCH conductor] BZ801199: Change latest_build to the latest in time

Jan Provaznik jprovazn at redhat.com
Tue Mar 13 15:54:11 UTC 2012


On 03/13/2012 01:51 PM, ifarkas at redhat.com wrote:
> From: Imre Farkas<ifarkas at redhat.com>
>
> https://bugzilla.redhat.com/show_bug.cgi?id=801199
> ---
>   src/app/controllers/images_controller.rb |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/app/controllers/images_controller.rb b/src/app/controllers/images_controller.rb
> index 846ff89..a06a249 100644
> --- a/src/app/controllers/images_controller.rb
> +++ b/src/app/controllers/images_controller.rb
> @@ -366,7 +366,7 @@ class ImagesController<  ApplicationController
>
>     def load_builds
>       @builds = @image.image_builds.sort {|a, b| a.timestamp<=>  b.timestamp}.reverse
> -    @latest_build = @image.latest_pushed_or_unpushed_build.uuid rescue nil
> +    @latest_build = @builds.first.uuid if @builds.any?
>       @build = if params[:build].present?
>                  @builds.find {|b| b.id == params[:build]}
>                elsif @latest_build

ACK, seems to work fine.



More information about the aeolus-devel mailing list