rosa-build/app/controllers/platforms/maintainers_controller.rb

17 lines
694 B
Ruby
Raw Normal View History

class Platforms::MaintainersController < Platforms::BaseController
2015-03-04 23:19:19 +00:00
before_action :authenticate_user!
skip_before_action :authenticate_user!, only: [:index] if APP_CONFIG['anonymous_access']
def index
2015-07-08 22:54:57 +01:00
@maintainer = BuildList::Package.new(build_list_package_params)
@packages = @platform.packages.actual.like_name(@maintainer.name)
@projects = @platform.projects.joins(:packages).merge( @packages ).
includes(:maintainer).group('projects.id').reorder(:name).paginate(page: params[:page])
@packages = @packages.where(project_id: @projects.map(&:id)).group_by(&:project_id)
end
def build_list_package_params
permit_params :build_list_package, :name
end
end