2012-05-04 23:53:45 +01:00
|
|
|
# -*- encoding : utf-8 -*-
|
2012-05-10 18:17:59 +01:00
|
|
|
class AdvisoriesController < ApplicationController
|
2012-05-04 23:53:45 +01:00
|
|
|
before_filter :authenticate_user!
|
2012-06-04 20:49:20 +01:00
|
|
|
skip_before_filter :authenticate_user! if APP_CONFIG['anonymous_access']
|
2012-06-18 23:49:17 +01:00
|
|
|
load_resource :find_by => :advisory_id
|
|
|
|
authorize_resource
|
2012-05-04 23:53:45 +01:00
|
|
|
|
|
|
|
def index
|
2012-06-20 15:07:07 +01:00
|
|
|
@advisories = @advisories.scoped(:include => :platforms).paginate(:page => params[:page])
|
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
|
|
|
format.atom
|
|
|
|
end
|
2012-05-04 23:53:45 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
2012-06-18 23:49:17 +01:00
|
|
|
@packages_info = Hash.new { |h, k| h[k] = {} }
|
|
|
|
@advisory.build_lists.find_in_batches(:include => [:save_to_platform, :packages, :project]) do |batch|
|
|
|
|
batch.each do |build_list|
|
|
|
|
h = { build_list.project => build_list.packages }
|
|
|
|
@packages_info[build_list.save_to_platform].merge!(h) { |pr, old, new| (old + new).compact!.uniq! }
|
|
|
|
end
|
|
|
|
end
|
2012-05-04 23:53:45 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|