rename constants

This commit is contained in:
Vokhmin Alexey V 2012-11-21 16:55:57 +04:00
parent 916a984b6d
commit c629c91bb7
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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