Project

General

Profile

Revision ab73d5cf

Added by Daniel Lobato Garcia over 8 years ago

Fixes #8236: 1.6 compatibility

View differences:

app/controllers/containers_controller.rb
1 1
class ContainersController < ::ApplicationController
2
  before_filter :find_resource, :only => [:show, :auto_complete_image, :auto_complete_image_tags,
3
                                          :commit]
2
  before_filter :find_container, :only => [:show,
3
                                           :auto_complete_image,
4
                                           :auto_complete_image_tags,
5
                                           :commit]
4 6

  
5 7
  def index
6 8
    @container_resources = allowed_resources.select { |cr| cr.provider == 'Docker' }
......
104 106
  def allowed_resources
105 107
    ComputeResource.authorized(:view_compute_resources)
106 108
  end
109

  
110
  # To be replaced by find_resource after 1.6 support is deprecated
111
  def find_container
112
    if params[:id].blank?
113
      not_found
114
      return
115
    end
116
    @container = Container.authorized("#{action_permission}_#{controller_name}".to_sym)
117
                          .find(params[:id])
118
  end
107 119
end

Also available in: Unified diff