#251: removed #search action

This commit is contained in:
Vokhmin Alexey V 2013-08-05 16:52:15 +04:00
parent 935cda4a0a
commit 63a26553cd
3 changed files with 3 additions and 18 deletions

View File

@ -1,9 +1,9 @@
# -*- encoding : utf-8 -*-
class Projects::BuildListsController < Projects::BaseController
NESTED_ACTIONS = [:search, :index, :new, :create]
NESTED_ACTIONS = [:index, :new, :create]
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, :only => [:show, :index, :search, :log] if APP_CONFIG['anonymous_access']
skip_before_filter :authenticate_user!, :only => [:show, :index, :log] if APP_CONFIG['anonymous_access']
before_filter :find_build_list, :only => [:show, :publish, :cancel, :update, :log, :create_container]
@ -11,15 +11,6 @@ class Projects::BuildListsController < Projects::BaseController
load_and_authorize_resource :build_list, :through => :project, :only => NESTED_ACTIONS, :shallow => true
load_and_authorize_resource :except => NESTED_ACTIONS
def search
new_params = {:filter => {}}
params[:filter].each do |k,v|
new_params[:filter][k] = v unless v.empty?
end
new_params[:per_page] = params[:per_page] if params[:per_page].present?
redirect_to @project ? project_build_lists_path(@project, new_params) : build_lists_path(new_params)
end
def index
params[:filter].each{|k,v| params[:filter].delete(k) if v.blank? } if params[:filter]

View File

@ -18,7 +18,6 @@ class Ability
can(:refs_list, Project) {|project| can? :show, project}
can :read, Issue, :project => {:visibility => 'open'}
can [:read, :commits, :files], PullRequest, :to_project => {:visibility => 'open'}
can :search, BuildList
can [:read, :log, :everything], BuildList, :project => {:visibility => 'open'}
can [:read, :log], ProductBuildList#, :product => {:platform => {:visibility => 'open'}} # double nested hash don't work
can [:read, :search], Advisory

View File

@ -263,9 +263,6 @@ Rosa::Application.routes.draw do
put :publish
put :reject_publish
end
collection {
post :search
}
end
resources :projects, :only => [:index, :new, :create]
@ -304,9 +301,7 @@ Rosa::Application.routes.draw do
end
post "/labels/:label_id" => "issues#destroy_label", :as => :issues_delete_label
post "/labels/:label_id/update" => "issues#update_label", :as => :issues_update_label
resources :build_lists, :only => [:index, :new, :create] do
collection { post :search }
end
resources :build_lists, :only => [:index, :new, :create]
resources :collaborators do
get :find, :on => :collection
end