rename constants
This commit is contained in:
parent
916a984b6d
commit
c629c91bb7
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class Api::V1::SearchController < Api::V1::BaseController
|
||||
TAGS = ['projects', 'users', 'groups', 'platforms']
|
||||
TYPES = ['projects', 'users', 'groups', 'platforms']
|
||||
|
||||
before_filter :authenticate_user! unless APP_CONFIG['anonymous_access']
|
||||
|
||||
|
@ -10,8 +10,8 @@ class Api::V1::SearchController < Api::V1::BaseController
|
|||
type = params[:type] || 'all'
|
||||
case type
|
||||
when 'all'
|
||||
TAGS.each{ |t| @results[t] = find_collection(t) }
|
||||
when *TAGS
|
||||
TYPES.each{ |t| @results[t] = find_collection(t) }
|
||||
when *TYPES
|
||||
@results[type] = find_collection(type)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class SearchController < ApplicationController
|
||||
TAGS = ['projects', 'users', 'groups', 'platforms']
|
||||
TYPES = ['projects', 'users', 'groups', 'platforms']
|
||||
|
||||
before_filter :authenticate_user! unless APP_CONFIG['anonymous_access']
|
||||
# load_and_authorize_resource
|
||||
|
@ -10,8 +10,8 @@ class SearchController < ApplicationController
|
|||
@query = params[:query]
|
||||
case @type
|
||||
when 'all'
|
||||
TAGS.each{ |t| find_collection(t) }
|
||||
when *TAGS
|
||||
TYPES.each{ |t| find_collection(t) }
|
||||
when *TYPES
|
||||
find_collection(@type)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue