privatize non-action controller method

This commit is contained in:
Fabián Rodríguez 2012-10-29 18:52:17 -02:00
parent b7a6f8b3b2
commit 76c48f3c9c

View file

@ -66,20 +66,6 @@ class PeopleController < ApplicationController
respond_with @people respond_with @people
end end
def hashes_for_people(people, aspects)
ids = people.map{|p| p.id}
contacts = {}
Contact.unscoped.where(:user_id => current_user.id, :person_id => ids).each do |contact|
contacts[contact.person_id] = contact
end
people.map{|p|
{:person => p,
:contact => contacts[p.id],
:aspects => aspects}
}
end
def show def show
@person = Person.find_from_guid_or_username(params) @person = Person.find_from_guid_or_username(params)
@ -162,6 +148,8 @@ class PeopleController < ApplicationController
end end
end end
private
def redirect_if_tag_search def redirect_if_tag_search
if search_query.starts_with?('#') if search_query.starts_with?('#')
if search_query.length > 1 if search_query.length > 1
@ -173,7 +161,19 @@ class PeopleController < ApplicationController
end end
end end
private def hashes_for_people(people, aspects)
ids = people.map{|p| p.id}
contacts = {}
Contact.unscoped.where(:user_id => current_user.id, :person_id => ids).each do |contact|
contacts[contact.person_id] = contact
end
people.map{|p|
{:person => p,
:contact => contacts[p.id],
:aspects => aspects}
}
end
def search_query def search_query
@search_query ||= params[:q] || params[:term] || '' @search_query ||= params[:q] || params[:term] || ''